-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d7c1c99
commit 6682f74
Showing
1 changed file
with
29 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,37 @@ | ||
# .github/workflows/release.yaml | ||
|
||
name: release | ||
|
||
# on events | ||
on: | ||
release: | ||
types: [created] | ||
types: | ||
- created | ||
|
||
# jobs | ||
jobs: | ||
releases-matrix: | ||
name: Release Go Binary | ||
# generate build cross-platform build files | ||
generate: | ||
name: Generate cross-platform builds | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
goos: [linux] | ||
goarch: [amd64, arm64] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: wangyoucao577/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
goos: ${{ matrix.goos }} | ||
goarch: ${{ matrix.goarch }} | ||
goversion: "https://dl.google.com/go/go1.18.1.linux-amd64.tar.gz" | ||
project_path: "." | ||
binary_name: "discord-bot" | ||
extra_files: README.md | ||
# step 1: checkout repository code | ||
- name: Checkout the repository | ||
uses: actions/checkout@v2 | ||
|
||
# step 2: generate build files | ||
- name: Generate build files | ||
uses: thatisuday/go-build-action@v1 | ||
with: | ||
platforms: "linux/amd64, linux/arm64, windows/amd64" | ||
name: "discord-bot" | ||
compress: "true" | ||
dest: "dist" | ||
|
||
# step 3: upload build-artifacts | ||
- name: Upload build-artifacts | ||
uses: skx/github-action-publish-binaries@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
args: "./dist/*.tar.gz" |