Skip to content

Commit

Permalink
test-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shivas committed Dec 16, 2023
1 parent 0e4a03a commit 767e111
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 18 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Go

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

jobs:

build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
architecture: x64

- name: Set up task
uses: pnorton5432/setup-task@v1

- name: Install build dependencies
run: go install github.com/gonutz/rsrc@latest

- name: Install UPX
uses: crazy-max/ghaction-upx@v3
with:
install-only: true

- name: Build and pack binaries
run: task pack
23 changes: 5 additions & 18 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tasks:

debug:
desc: Builds artifacts for release
deps: [install-deps, resources]
deps: [test, install-deps, resources]
cmds:
- go generate ./...
- go build -trimpath -ldflags "-s -w -X github.com/shivas/abyss-blackbox/internal/version.RecorderVersion={{.GIT_VERSION}} -X github.com/shivas/abyss-blackbox/internal/version.GoVersion={{.GO_VERSION}}" -o abyss-blackbox.exe ./cmd/abyss-blackbox
Expand All @@ -42,7 +42,7 @@ tasks:

release:
desc: Builds artifacts for release
deps: [install-deps, resources]
deps: [test, install-deps, resources]
cmds:
- go generate ./...
- go build -trimpath -ldflags="-H windowsgui -s -w -X github.com/shivas/abyss-blackbox/internal/version.RecorderVersion={{.GIT_VERSION}} -X github.com/shivas/abyss-blackbox/internal/version.GoVersion={{.GO_VERSION}}" -o abyss-blackbox.exe ./cmd/abyss-blackbox
Expand All @@ -53,23 +53,10 @@ tasks:
GO_VERSION:
sh: go env GOVERSION

win7:
desc: Builds artifacts for release
deps: [install-deps, resources]
env:
GOARCH: 386
cmds:
- go generate ./...
- go build -trimpath -ldflags="-H windowsgui -s -w -X github.com/shivas/abyss-blackbox/internal/version.RecorderVersion={{.GIT_VERSION}} -X github.com/shivas/abyss-blackbox/internal/version.GoVersion={{.GO_VERSION}}" -o abyss-blackbox32.exe ./cmd/abyss-blackbox
- go build -trimpath -ldflags="-s -w" ./cmd/extract/
vars:
GIT_VERSION:
sh: git describe --tags --always
GO_VERSION:
sh: go env GOVERSION

pack:
desc: Compress executables with UPX
deps:
- release
cmds:
- upx abyss-blackbox.exe
- upx abyss-blackbox32.exe
- upx extract.exe

0 comments on commit 767e111

Please sign in to comment.