Skip to content

Merge pull request #65 from Addono/dependabot/npm_and_yarn/eslint-10.2.0 #136

Merge pull request #65 from Addono/dependabot/npm_and_yarn/eslint-10.2.0

Merge pull request #65 from Addono/dependabot/npm_and_yarn/eslint-10.2.0 #136

Workflow file for this run

name: Release
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
issues: write
pull-requests: write
packages: write
id-token: write
jobs:
next-version:
name: Resolve next version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.resolve.outputs.version }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: npm install -g npm@^11.5.1
- run: npm ci
- id: resolve
run: |
OUTPUT="$(npx semantic-release --dry-run --no-ci --plugins @semantic-release/commit-analyzer @semantic-release/release-notes-generator 2>&1 | tee /dev/stderr)"
VERSION="$(printf '%s\n' "$OUTPUT" | sed -nE 's/.*The next release version is ([0-9]+\.[0-9]+\.[0-9]+).*/\1/p' | tail -n 1)"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-binaries:
name: Build ${{ matrix.asset_name }}
runs-on: ${{ matrix.os }}
needs: next-version
if: needs.next-version.outputs.version != ''
strategy:
matrix:
include:
- os: ubuntu-latest
asset_name: gh-attach-linux-amd64
pkg_target: node18-linux-x64
- os: macos-14
asset_name: gh-attach-darwin-amd64
pkg_target: node18-macos-x64
- os: macos-14
asset_name: gh-attach-darwin-arm64
pkg_target: node18-macos-arm64
- os: windows-latest
asset_name: gh-attach-windows-amd64.exe
pkg_target: node18-win-x64
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: npm install -g npm@^11.5.1
- run: npm ci
- run: npm run build
env:
GH_ATTACH_BUILD_VERSION: ${{ needs.next-version.outputs.version }}
- run: npm run package
env:
GH_ATTACH_BUILD_VERSION: ${{ needs.next-version.outputs.version }}
GH_ATTACH_PKG_TARGETS: ${{ matrix.pkg_target }}
- uses: actions/upload-artifact@v7
with:
name: ${{ matrix.asset_name }}
path: bin/${{ matrix.asset_name }}
validate-release-candidate:
name: Validate release candidate
runs-on: ubuntu-latest
needs: [next-version, build-binaries]
if: needs.next-version.outputs.version != ''
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: npm install -g npm@^11.5.1
- run: npm ci
- uses: actions/download-artifact@v8
with:
path: bin
pattern: gh-attach-*
merge-multiple: true
- name: Restore binary permissions
run: chmod +x bin/gh-attach-linux-amd64 bin/gh-attach-darwin-amd64 bin/gh-attach-darwin-arm64
- name: Verify packaged binaries
run: |
test -f bin/gh-attach-linux-amd64
test -f bin/gh-attach-darwin-amd64
test -f bin/gh-attach-darwin-arm64
test -f bin/gh-attach-windows-amd64.exe
- run: npm run build
env:
GH_ATTACH_BUILD_VERSION: ${{ needs.next-version.outputs.version }}
- run: npm test
env:
GH_ATTACH_BUILD_VERSION: ${{ needs.next-version.outputs.version }}
release:
name: Semantic Release
runs-on: ubuntu-latest
needs: [next-version, build-binaries, validate-release-candidate]
if: needs.next-version.outputs.version != ''
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-node@v6
with:
node-version: 24
cache: npm
- run: npm install -g npm@^11.5.1
- run: npm ci
- uses: actions/download-artifact@v8
with:
path: bin
pattern: gh-attach-*
merge-multiple: true
- name: Restore binary permissions
run: chmod +x bin/gh-attach-linux-amd64 bin/gh-attach-darwin-amd64 bin/gh-attach-darwin-arm64
- name: Verify packaged binaries
run: |
test -f bin/gh-attach-linux-amd64
test -f bin/gh-attach-darwin-amd64
test -f bin/gh-attach-darwin-arm64
test -f bin/gh-attach-windows-amd64.exe
- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}