From 200ea0930a311c250ad8f58dc1e17c436a7133ad Mon Sep 17 00:00:00 2001 From: Darren Kelly Date: Tue, 11 Jun 2024 15:05:43 +0100 Subject: [PATCH 1/4] feat: add a release action --- .github/workflows/on-release.yaml | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/on-release.yaml diff --git a/.github/workflows/on-release.yaml b/.github/workflows/on-release.yaml new file mode 100644 index 0000000..57988b2 --- /dev/null +++ b/.github/workflows/on-release.yaml @@ -0,0 +1,48 @@ +name: Release + +on: + push: + tags: + - '*' + +permissions: + contents: write + +jobs: + build: + name: Build + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + include: + - os: ubuntu-latest + goos: linux + - os: macos-latest + goos: darwin + - os: windows-latest + goos: windows + goarch: [ amd64, 386 ] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.19.x + + - name: Build binary + env: + GOOS: ${{ matrix.goos }} + GOARCH: ${{ matrix.goarch }} + run: | + go build -v -o networkHub-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/main.go + + - name: Upload ZIP to release + uses: xresloader/upload-to-github-release@v1.6.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + file: networkHub-${{ matrix.goos }}-${{ matrix.goarch }} From 5038fe69d304d22e60a6a05d10da1a4fc303003e Mon Sep 17 00:00:00 2001 From: Darren Kelly Date: Tue, 11 Jun 2024 15:06:39 +0100 Subject: [PATCH 2/4] fix: update release action --- .github/workflows/on-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/on-release.yaml b/.github/workflows/on-release.yaml index 57988b2..95345f0 100644 --- a/.github/workflows/on-release.yaml +++ b/.github/workflows/on-release.yaml @@ -39,7 +39,7 @@ jobs: run: | go build -v -o networkHub-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/main.go - - name: Upload ZIP to release + - name: Upload Executable uses: xresloader/upload-to-github-release@v1.6.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 1c27119c83e1f561b3498b056af02d51952b1431 Mon Sep 17 00:00:00 2001 From: Darren Kelly Date: Tue, 11 Jun 2024 15:23:32 +0100 Subject: [PATCH 3/4] fix: update go.mod / tests version --- .github/workflows/test.yaml | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 56e3a42..9a092bb 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,7 +14,7 @@ jobs: - name: Install Go uses: actions/setup-go@v4 with: - go-version: 1.19.x + go-version: 1.21.x - name: Make Test id: unit-test diff --git a/go.mod b/go.mod index 479d6fa..729b5db 100644 --- a/go.mod +++ b/go.mod @@ -46,4 +46,4 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -go 1.19 +go 1.21 From 07e97fa3e47c6bd33f31e6ff1f0eed258ce586d4 Mon Sep 17 00:00:00 2001 From: Darren Kelly Date: Tue, 11 Jun 2024 15:36:30 +0100 Subject: [PATCH 4/4] fix: disable TestLocal and update release --- .github/workflows/on-release.yaml | 12 +++++++++--- environments/local/local_test.go | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/on-release.yaml b/.github/workflows/on-release.yaml index 95345f0..51a99d3 100644 --- a/.github/workflows/on-release.yaml +++ b/.github/workflows/on-release.yaml @@ -4,6 +4,12 @@ on: push: tags: - '*' + workflow_dispatch: + inputs: + tag: + description: 'Tag to release' + required: true + default: 'v0.0.0' permissions: contents: write @@ -22,7 +28,7 @@ jobs: goos: darwin - os: windows-latest goos: windows - goarch: [ amd64, 386 ] + goarch: [ 386, amd64, arm, arm64 ] steps: - name: Checkout code uses: actions/checkout@v4 @@ -44,5 +50,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ github.ref_name }} - file: networkHub-${{ matrix.goos }}-${{ matrix.goarch }} + tag_name: ${{ github.ref_name || inputs.tag }} + file: networkHub-${{ matrix.goos }}-${{ matrix.goarch }}${{ runner.os == 'Windows' && '.exe' }} diff --git a/environments/local/local_test.go b/environments/local/local_test.go index 68d0d8a..de79449 100644 --- a/environments/local/local_test.go +++ b/environments/local/local_test.go @@ -122,7 +122,7 @@ var networkJSON = fmt.Sprintf(`{ }`, genesis, genesis, genesis) func TestLocal(t *testing.T) { - //t.Skip() + t.Skip() networkCfg, err := network.NewNetwork( network.WithJSON(networkJSON), )