Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions .github/workflows/gnd-binary-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Build gnd Binaries
on:
workflow_dispatch:
inputs:
release_tag:
description: 'Existing release tag to upload binaries to and publish as on npm (e.g. v0.44.0). Leave empty to only build artifacts.'
type: string
default: ''
dry_run:
description: 'Dry-run npm publish (no actual publish)'
type: boolean
Expand Down Expand Up @@ -130,7 +134,7 @@ jobs:
release:
name: Create Release
needs: build
if: startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/') || inputs.release_tag != ''
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -153,10 +157,8 @@ jobs:

- name: Upload Assets to Release
run: |
# Extract version from ref (remove refs/tags/ prefix)
VERSION=${GITHUB_REF#refs/tags/}

# Upload Linux x86_64 asset
VERSION="${{ inputs.release_tag != '' && inputs.release_tag || github.ref_name }}"

gh release upload $VERSION --clobber --repo $GITHUB_REPOSITORY \
artifacts/gnd-linux-x86_64/gnd-linux-x86_64.gz \
artifacts/gnd-linux-aarch64/gnd-linux-aarch64.gz \
Expand All @@ -169,7 +171,7 @@ jobs:
publish-npm:
name: Publish npm package for ${{ matrix.platform }}
needs: release
if: startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/') || inputs.release_tag != ''
runs-on: ubuntu-latest
permissions:
id-token: write
Expand Down Expand Up @@ -212,7 +214,7 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download "${{ github.ref_name }}" \
gh release download "${{ inputs.release_tag != '' && inputs.release_tag || github.ref_name }}" \
--repo "${{ github.repository }}" \
--pattern "${{ matrix.asset }}" \
--output ./binary-archive
Expand All @@ -232,7 +234,7 @@ jobs:
id: version
shell: bash
run: |
VERSION="${{ github.ref_name }}"
VERSION="${{ inputs.release_tag != '' && inputs.release_tag || github.ref_name }}"
VERSION="${VERSION#v}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
# Prerelease versions (e.g. 0.42.2-dev.1) need an explicit --tag
Expand Down Expand Up @@ -283,7 +285,7 @@ jobs:
publish-npm-wrapper:
name: Publish @graphprotocol/gnd wrapper
needs: publish-npm
if: startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/') || inputs.release_tag != ''
runs-on: ubuntu-latest
permissions:
id-token: write
Expand All @@ -299,7 +301,7 @@ jobs:
id: version
shell: bash
run: |
VERSION="${{ github.ref_name }}"
VERSION="${{ inputs.release_tag != '' && inputs.release_tag || github.ref_name }}"
VERSION="${VERSION#v}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
if [[ "$VERSION" == *-* ]]; then
Expand Down
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading