Skip to content

Commit

Permalink
Use release script instead of action
Browse files Browse the repository at this point in the history
  • Loading branch information
infogulch committed Feb 22, 2024
1 parent e4f3d7d commit ca53028
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@ jobs:
- name: Run Hurl Tests
run: ./test/exec.sh

- uses: thatisuday/go-cross-build@v1
with:
platforms: 'linux/amd64, darwin/amd64, windows/amd64'
package: 'cmd'
name: 'xtemplate'
compress: 'true'
dest: 'dist'
- name: Build binaries for all platforms
run: release.sh

- uses: actions/upload-artifact@v3
with:
path: dist/*
path: 'dist/*'

- name: Release
if: startsWith(github.ref, 'refs/tags/v')
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ go.work*
xtemplate
xtemplate.exe
caddy
dist
18 changes: 18 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -ex

go tool dist list

rm -r dist

GOOS=linux GOARCH=amd64 go build -buildmode exe -o ./dist/xtemplate-amd64-linux/xtemplate ./cmd
GOOS=darwin GOARCH=amd64 go build -buildmode exe -o ./dist/xtemplate-amd64-darwin/xtemplate ./cmd
GOOS=windows GOARCH=amd64 go build -buildmode exe -o ./dist/xtemplate-amd64-windows/xtemplate.exe ./cmd

printf '%s\n' dist/* | while read D; do
cp README.md LICENSE "$D"
tar czvf "$D.tar.gz" "$D/"
rm -r "$D"
done

ls -lh dist/*

0 comments on commit ca53028

Please sign in to comment.