diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 00000000..49466bec --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,40 @@ +name: Draft Release + +on: + push: + branches: [ main ] + +jobs: + next-release: + permissions: + contents: write + pull-requests: read + runs-on: ubuntu-latest + timeout-minutes: 2 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate next version + id: calver + run: | + today=$(date +%Y%m%d) + release=1 + + while [ ! -z $(git tag -l ${today}.${release}) ]; do + release=$((release+1)) + done + + next_version="${today}.${release}" + echo "version=${next_version}" >> $GITHUB_OUTPUT + + - uses: embrace-io/release-drafter@v6 + with: + config-name: release-drafter.yml + disable-autolabeler: true + name: ${{ steps.calver.outputs.version }} + tag: ${{ steps.calver.outputs.version }} + version: ${{ steps.calver.outputs.version }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}