Go #4
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: Go | |
on: | |
workflow_dispatch: | |
# branches: | |
# - master #STOP | |
jobs: | |
build: | |
name: Build and Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.19 | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '>=1.19.2' | |
id: go | |
- name: Checkout code into the Go module directory | |
uses: actions/checkout@v3 | |
- name: Get dependencies | |
run: | | |
go get -v -t -d ./... | |
- name: Build | |
run: go build -v -o binary1 | |
# Add more binaries if needed; adjust the names accordingly | |
- name: List generated files | |
run: ls -la | |
- name: Install tshark as a prerequisite for testing | |
run: | | |
sudo sh -c 'export DEBIAN_FRONTEND=noninteractive ; apt -y update && apt -y install tshark' | |
- name: Test | |
run: go test -v ./... | |
- name: Create Tarball | |
run: tar -czvf release.tar.gz ./binary1 | |
# Add more binaries if needed; adjust the names accordingly | |
- name: List artifacts | |
run: ls -la | |
- name: Create Release and Upload Artifacts | |
uses: actions/create-release@v1 | |
with: | |
tag_name: v0.0.1 | |
release_name: Release v0.0.1 | |
body: Test build and release binaries remotely. | |
draft: false | |
prerelease: false | |
files: | | |
release.tar.gz | |
token: ${{ secrets.MY_TOKEN }} |