Using goreleaser now, no need for the workflow build
All checks were successful
CI / test (push) Successful in 2m4s

This commit is contained in:
Justin Hawkins 2025-06-18 14:43:47 +02:00
parent 4d3deaad32
commit 1bf7aa8a66

View File

@ -40,83 +40,3 @@ jobs:
with: with:
name: coverage.html name: coverage.html
path: ./cover.html path: ./cover.html
build:
needs: test
runs-on: ubuntu-22.04
env:
RUNNER_TOOL_CACHE: /toolcache # Runner Tool Cache
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.24.4' # The Go version to download (if necessary) and use.
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
id: hash-go
with:
patterns: |
go.mod
go.sum
- name: Echo hash
run: echo ${{ steps.hash-go.outputs.hash }}
- name: Cache go
id: cache-go
uses: https://github.com/actions/cache@v3 # Action cache
with: # specify with your GOMODCACHE and GOCACHE
path: |-
/root/go/pkg/mod
/root/.cache/go-build
key: go_cache-${{ steps.hash-go.outputs.hash }}
restore-keys: |-
go_cache-${{ steps.hash-go.outputs.hash }}
# build all binaries
- name: build binaries
run: |
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o charmite_darwin_amd64 .
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -o charmite_darwin_arm64 .
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o charmite_linux_amd64 .
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o charmite_windows_amd64.exe .
# upload
- name: Upload artifacts to Gitea package repository
env:
GITEA_API_URL: https://code.ppl.town/api
GITEA_TOKEN: ${{ secrets.PACKAGE_API_KEY }}
OWNER: justin
VERSION: 0.0.1
run: |
# charmite_darwin_amd64
curl -D- -s -X DELETE "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_darwin_amd64" \
-H "Authorization: token $GITEA_TOKEN"
curl -D- -s -X PUT "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_darwin_amd64" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @charmite_darwin_amd64
curl -D- -s -X DELETE "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_darwin_arm64" \
-H "Authorization: token $GITEA_TOKEN"
curl -D- -s -X PUT "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_darwin_arm64" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @charmite_darwin_arm64
curl -D- -s -X DELETE "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_linux_amd64" \
-H "Authorization: token $GITEA_TOKEN"
curl -D- -s -X PUT "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_linux_amd64" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @charmite_linux_amd64
curl -D- -s -X DELETE "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_windows_amd64.exe" \
-H "Authorization: token $GITEA_TOKEN"
curl -D- -s -X PUT "$GITEA_API_URL/packages/$OWNER/generic/charmite/$VERSION/charmite_windows_amd64.exe" \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @charmite_windows_amd64.exe