automate release
This commit is contained in:
parent
c39393e69a
commit
ce2f49a194
1 changed files with 39 additions and 0 deletions
39
.github/workflows/release.yaml
vendored
Normal file
39
.github/workflows/release.yaml
vendored
Normal 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
|
||||
Loading…
Reference in a new issue