name: Release Drafter on: push: branches: - main jobs: update_release_draft: runs-on: ubuntu-latest name: Release Drafter steps: - name: Checkout the repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 - name: Find Next Version id: version run: | declare -i newpost latest=$(git describe --tags $(git rev-list --tags --max-count=1)) latestpre=$(echo "$latest" | awk '{split($0,a,"."); print a[1] "." a[2]}') datepre=$(date --utc '+%Y.%m') if [[ "$latestpre" == "$datepre" ]]; then latestpost=$(echo "$latest" | awk '{split($0,a,"."); print a[3]}') newpost=$latestpost+1 else newpost=0 fi echo Current version: $latest echo New target version: $datepre.$newpost echo "version=$datepre.$newpost" >> "$GITHUB_OUTPUT" - name: Run Release Drafter uses: release-drafter/release-drafter@139054aeaa9adc52ab36ddf67437541f039b88e2 # v7.1.1 with: tag: ${{ steps.version.outputs.version }} name: ${{ steps.version.outputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}