Skip to content

Commit

Permalink
gh: Add new build workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Evgenii Baidakov <[email protected]>
  • Loading branch information
smallhive committed Sep 20, 2023
1 parent 5d6437c commit 533e313
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build

on:
pull_request:
branches:
- master
types: [ opened, synchronize ]
paths-ignore:
- '**/*.md'
push:
# Build for the master branch.
branches:
- master
release:
# Publish released commit as Docker `latest` and `git_revision` images.
types:
- published

jobs:
build_cli:
name: Build CLI
runs-on: ${{matrix.os.name}}
strategy:
matrix:
os: [ { name: ubuntu-20.04, bin-name: linux } ]
arch: [ amd64 ]

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: true

- name: Update Go modules
run: go mod download -json

- name: Build CLI
run: make
env:
GOARCH: ${{ matrix.arch }}

- name: Rename CLI binary
run: mv ./xk6-neofs* ./xk6-neofs-${{ matrix.os.bin-name }}-${{ matrix.arch }}

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: xk6-neofs-${{ matrix.os.bin-name }}-${{ matrix.arch }}
path: ./xk6-neofs*
if-no-files-found: error

- name: Attach binary to the release as an asset
if: ${{ github.event_name == 'release' }}
run: gh release upload ${{ github.event.release.tag_name }} ./xk6-neofs-${{ matrix.os.bin-name }}-${{ matrix.arch }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 533e313

Please sign in to comment.