Update go.yml #11
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 Release Binaries | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
build: | |
name: Build Release Binaries | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.22 | |
- name: Copy files to build directory | |
run: | | |
mkdir -p build/cmd | |
mkdir -p build/internal | |
cp go.mod ./build | |
cp go.sum ./build | |
cp ./cmd/main.go ./build/cmd/ | |
cp -R ./internal/* ./build/internal/ | |
- name: Install dependencies | |
run: | | |
cd build | |
go mod download | |
go mod tidy | |
- name: Build Binary | |
run: | | |
cd ./build | |
go build -ldflags "-w -s" -o ./littlelinks-generator cmd/main.go | |
- name: Upload Release Artifacts | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: ./build/littlelinks-generator | |
asset_name: littlelinks-generator | |
asset_content_type: application/octet-stream | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |