Skip to content

Commit

Permalink
Merge pull request #5 from vechain/fix-release-workflow
Browse files Browse the repository at this point in the history
fix: release workflow
  • Loading branch information
otherview authored Jun 13, 2024
2 parents 0838fc8 + b7a24d0 commit d49d7ab
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions .github/workflows/on-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,52 @@ on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to release'
description: 'Tag to release, eg. v0.0.1'
required: true
default: 'v0.0.0'

permissions:
contents: write

jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
include:
- os: ubuntu-latest
goos: linux
- os: macos-latest
# TODO: Add support for arm based runners when GH makes them generally available
- runner: macos-latest
goos: darwin
- os: windows-latest
goarch: arm64
- runner: ubuntu-latest
goos: linux
goarch: amd64
- runner: windows-latest
goos: windows
goarch: [ 386, amd64, arm, arm64 ]
goarch: amd64
runs-on: ${{ matrix.runner }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.19.x
go-version: 1.22.x

- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
go build -v -o networkHub-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/main.go
go build -v -o network-hub-${{ matrix.goos == 'darwin' && 'macos' || matrix.goos }}-${{ matrix.goarch }}${{ runner.os == 'Windows' && '.exe' || '' }} ./cmd/main.go
- name: Upload Executable
uses: xresloader/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name || inputs.tag }}
file: networkHub-${{ matrix.goos }}-${{ matrix.goarch }}${{ runner.os == 'Windows' && '.exe' }}
tag_name: ${{ inputs.tag || github.ref_name }}
file: network-hub-${{ matrix.goos == 'darwin' && 'macos' || matrix.goos }}-${{ matrix.goarch }}${{ runner.os == 'Windows' && '.exe' || '' }}
overwrite: true

0 comments on commit d49d7ab

Please sign in to comment.