Add dependency installation step to GitHub Actions workflow #3
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 and Release Linodsync Binary | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build Static Linux Binary | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.20 | |
- name: Install dependencies | |
run: go mod tidy | |
- name: Build static binary for Linux amd64 | |
run: | | |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o linodsync | |
mkdir -p build | |
mv linodsync build/ | |
release: | |
name: Create GitHub Release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Upload release assets | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: build/linodsync | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |