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

GitHub Actions: Add stunnerd and turncat binaries to release assets #7

Closed
wants to merge 10 commits into from
43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
run: docker build . --file Dockerfile --tag l7mp/stunnerd:latest
- name: Push the latest Docker image
run: docker push l7mp/stunnerd:latest

push_chart:
name: Push charts to the web
runs-on: ubuntu-latest
Expand Down Expand Up @@ -58,3 +59,45 @@ jobs:
git add .
git commit -m "Update helm charts from l7mp/stunner" -m "(triggered by the 'Helm release' github action.)"
git push origin master

add_binaries:
name: Add binaries to the release
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '>=1.18.0'

- name: Install dependencies
run: go mod download

- name: Compile stunnerd
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-w -s" -o stunnerd ./cmd/stunnerd/...

- name: Compile turncat
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-w -s" -o turncat ./cmd/turncat/...

- name: Get release
id: get_release
uses: bruceadams/get-release@v1.2.3
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Add stunnerd binary
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: stunnerd

- name: Add turncat binary
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: turncat
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ COPY pkg/apis/v1alpha1/ pkg/apis/v1alpha1/
COPY cmd/stunnerd/main.go cmd/stunnerd/
COPY cmd/stunnerd/stunnerd.conf cmd/stunnerd/

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o stunnerd cmd/stunnerd/main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -trimpath -o stunnerd cmd/stunnerd/main.go

###########
# STUNNERD
Expand Down