Release process fix #11
Workflow file for this run
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: Release | |
| on: | |
| push: | |
| tags: ["v*"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| bump-versions: | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Extract version from tag | |
| run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV" | |
| - name: Bump versions and push | |
| run: bash scripts/bump-version.sh "$VERSION" --commit | |
| build-vsix: | |
| needs: [bump-versions] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install extension dependencies | |
| working-directory: src/Nap.VsCode | |
| run: npm ci | |
| - name: Compile extension | |
| working-directory: src/Nap.VsCode | |
| run: npx webpack --mode production | |
| - name: Package universal VSIX | |
| working-directory: src/Nap.VsCode | |
| run: npx @vscode/vsce package --no-dependencies --skip-license | |
| - name: Upload VSIX | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vsix | |
| path: src/Nap.VsCode/*.vsix | |
| build-cli: | |
| needs: [bump-versions] | |
| strategy: | |
| matrix: | |
| include: | |
| - rid: osx-arm64 | |
| asset: napper-osx-arm64 | |
| - rid: osx-x64 | |
| asset: napper-osx-x64 | |
| - rid: linux-x64 | |
| asset: napper-linux-x64 | |
| - rid: win-x64 | |
| asset: napper-win-x64.exe | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "10.0.x" | |
| - name: Publish CLI (${{ matrix.rid }}) | |
| run: | | |
| dotnet publish src/Nap.Cli/Nap.Cli.fsproj \ | |
| -r ${{ matrix.rid }} \ | |
| --self-contained \ | |
| -p:PublishTrimmed=true \ | |
| -p:PublishSingleFile=true \ | |
| -o out/${{ matrix.rid }} \ | |
| --nologo | |
| - name: Prepare asset | |
| run: | | |
| if [ "${{ matrix.rid }}" = "win-x64" ]; then | |
| mv out/${{ matrix.rid }}/napper.exe ${{ matrix.asset }} | |
| else | |
| mv out/${{ matrix.rid }}/napper ${{ matrix.asset }} | |
| chmod +x ${{ matrix.asset }} | |
| fi | |
| - name: Upload CLI binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cli-${{ matrix.rid }} | |
| path: ${{ matrix.asset }} | |
| release: | |
| needs: [build-vsix, build-cli] | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: assets | |
| merge-multiple: true | |
| - name: Generate SHA256 checksums | |
| working-directory: assets | |
| run: sha256sum * > ../checksums-sha256.txt | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| assets/* | |
| checksums-sha256.txt |