From ce2f49a19401a37eda7beb30e1406b8eccbe5b87 Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Mon, 20 Feb 2023 16:58:24 -0800 Subject: [PATCH] automate release --- .github/workflows/release.yaml | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..2080b9a0 --- /dev/null +++ b/.github/workflows/release.yaml @@ -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 \ No newline at end of file