upd nuspec #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: draft-release.yml | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| releaseDraft: | |
| name: Release draft | |
| if: github.event_name != 'pull_request' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| # Check out the current repository | |
| - name: Fetch Sources | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: master | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build | |
| run: npm run build | |
| - name: Get Version | |
| id: get-version | |
| uses: beaconbrigade/[email protected] | |
| with: | |
| path: . | |
| - name: Read CHANGELOG.md | |
| id: changelog | |
| uses: jaywcjlove/github-action-read-file@main | |
| with: | |
| path: CHANGELOG.md | |
| # Remove old release drafts by using the curl request for the available releases with a draft flag | |
| - name: Remove Old Release Drafts | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh api repos/{owner}/{repo}/releases \ | |
| --jq '.[] | select(.draft == true) | .id' \ | |
| | xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{} | |
| # Create a new release draft which is not publicly visible and requires manual acceptance | |
| - name: Create Release Draft | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release create "v${{ steps.get-version.outputs.version }}" \ | |
| --draft \ | |
| --title "v${{ steps.get-version.outputs.version }}" \ | |
| --notes "$(cat << 'EOM' | |
| ${{ steps.changelog.outputs.content }} | |
| EOM | |
| )" |