Skip to content

Workflow file for this run

name: Release Go Binary
on:
release:
types: [created]
workflow_dispatch: # Allows manual trigger
permissions:
contents: write
packages: write
jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Up Go
uses: actions/setup-go@v4
with:
go-version: "1.20" # Adjust Go version as per requirement
- name: Build Go Binary
run: |
echo "Building for ${{ matrix.goos }}-${{ matrix.goarch }}"
GO111MODULE=on CGO_ENABLED=0 GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} \
go build -o file-encryptor-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/file-encryptor
- name: Upload Release Assets
uses: softprops/action-gh-release@v1
with:
files: |
file-encryptor-linux-amd64
file-encryptor-windows-amd64.exe
file-encryptor-darwin-amd64
LICENSE
README.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}