Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added release workflow #7

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/release-wattpad.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build and Release

on:
release:
types: [ published ]

jobs:
build:
name: Build and Release
runs-on: ubuntu-latest

strategy:
matrix:
go_os: [ linux, darwin, windows ]
go_arch: [ amd64, arm64 ]

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x

# Build the go-task binary from the current repository
- name: Build go-task for ${{ matrix.go_os }}-${{ matrix.go_arch }}
run: |
GOOS=${{ matrix.go_os }} \
GOARCH=${{ matrix.go_arch }} \
CGO_ENABLED=0 \
go build \
-o task \
./cmd/task

# Compress the go-task binary
- name: Compress go-task for ${{ matrix.go_os }}-${{ matrix.go_arch }}
run: |
tar -cvzf task_${{ matrix.go_os }}_${{ matrix.go_arch }}.tar.gz \
task \
README.md \
LICENSE \
completion/

- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ github.event.release.tag_name }} ./task_${{ matrix.go_os }}_${{ matrix.go_arch }}.tar.gz
Loading