fixing the release build to move the generated files #9
Workflow file for this run
This file contains 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: Build | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
cleanup-runs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: rokroskar/workflow-run-cleanup-action@master | |
env: | |
GITHUB_TOKEN: "${{ secrets.SERV_BUILD_KEY }}" | |
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'" | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goos: [linux, darwin, windows] | |
goarch: [amd64, arm64, 386] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v2 | |
with: | |
go-version: '1.20' | |
- name: Build | |
run: | | |
export GOOS=${{ matrix.goos }} | |
export GOARCH=${{ matrix.goarch }} | |
go build -v -o servnode-${{ matrix.goos }}-${{ matrix.goarch }} ./... | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: servnode-${{ matrix.goos }}-${{ matrix.goarch }} | |
path: ./servnode-${{ matrix.goos }}-${{ matrix.goarch }} | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v2 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.SERV_BUILD_KEY }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Attach Artifacts to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.SERV_BUILD_KEY }} | |
file: servnode-* | |
asset_name: servnode-${{ github.ref }}-${{ matrix.goos }}-${{ matrix.goarch }} | |
tag: ${{ github.ref }} | |
overwrite: true |