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

add gh action to create release artifacts #13

Merged
merged 2 commits into from
Mar 19, 2024
Merged
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
41 changes: 41 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "Create draft release with binaries after tag"
on:
push:
tags: ["v*"]
permissions:
contents: write # to upload the binaries to the release
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: ["linux"]
arch: ["amd64", "arm64"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.20"
- run: mkdir build
- run: go build -trimpath -o build/lk-jwt-service_${{ matrix.os }}_${{ matrix.arch }} ./main.go
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
- name: "Upload binary as artifact"
uses: actions/upload-artifact@v3
with:
name: binary_${{ matrix.os }}_${{ matrix.arch }}
path: build/lk-jwt-service_${{ matrix.os }}_${{ matrix.arch }}

create-release:
needs: ["build"]
runs-on: ubuntu-latest
steps:
- name: "Fetch all binaries"
uses: actions/download-artifact@v3
- name: "Create release"
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
with:
files: build/*
draft: True
fail_on_unmatched_files: true
Loading