automate release

This commit is contained in:
Jesse Bannon 2023-02-20 16:58:24 -08:00
parent c39393e69a
commit ce2f49a194

39
.github/workflows/release.yaml vendored Normal file
View file

@ -0,0 +1,39 @@
name: ytld-sub release
on:
push:
# publish only when pushed to master
branches:
- master
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get release version
run:
date +'%Y.%m.%d' >> $DATE
git rev-list --count HEAD --since="$(DATE) 00:00:00" >> $DATE_COMMIT_COUNT
if [ "$(DATE_COMMIT_COUNT)" = "0" ]; then
echo "$DATE" >> $PYPI_VERSION
else
echo "$(DATE).post$(DATE_COMMIT_COUNT)" >> $PYPI_VERSION
endif
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: $(PYPI_VERSION)
release_name: ytdl-sub $(PYPI_VERSION)
body: |
See https://github.com/jmbannon/ytdl-sub#installation for installation steps
draft: false
prerelease: false