Release #5
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: | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write # Required for Sigstore signing | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm test | |
| - name: Build TypeScript | |
| run: npm run build | |
| - name: Install pkg globally | |
| run: npm install -g pkg | |
| - name: Build binaries | |
| run: npm run build:binaries | |
| - name: Update distribution files | |
| run: npm run update:distribution | |
| # Temporarily disabled Sigstore signing due to action compatibility issues | |
| # Will be re-enabled in v1.0.1 with proper Sigstore integration | |
| # - name: Sign binaries with Sigstore | |
| # uses: sigstore/gh-action-sigstore-python@v2.1.1 | |
| # with: | |
| # inputs: | | |
| # dist-binaries/*.tar.gz | |
| # dist-binaries/*.zip | |
| # upload-signing-artifacts: false | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2.0.8 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: | | |
| dist-binaries/*.tar.gz | |
| dist-binaries/*.zip | |
| dist-binaries/checksums.txt | |
| install.sh | |
| distribution.tar.gz | |
| generate_release_notes: true | |
| draft: false | |
| prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }} | |
| - name: Commit updated distribution files | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add homebrew/peezy.rb scoop/peezy.json install.sh | |
| git diff --staged --quiet || git commit -m "Update distribution files for ${{ github.ref_name }}" | |
| git push origin HEAD:main || echo "No changes to push" | |
| - name: Create distribution archive | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| mkdir -p distribution | |
| cp homebrew/peezy.rb distribution/ | |
| cp scoop/peezy.json distribution/ | |
| cp install.sh distribution/ | |
| tar -czf distribution.tar.gz distribution/ | |
| publish-npm: | |
| runs-on: ubuntu-latest | |
| needs: build-and-release | |
| if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, 'alpha') | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| - name: Publish to npm | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| continue-on-error: true |