Skip to content

Commit bc28a57

Browse files
authored
Merge pull request #1 from josemiguelo/master
Add a GH action for building jumpkwapp-go on the cloud
2 parents 2c12373 + 48e12b4 commit bc28a57

2 files changed

Lines changed: 67 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [master]
7+
paths:
8+
- "**.go"
9+
- "**.js"
10+
- "go.mod"
11+
- "go.sum"
12+
- ".github/workflows/build.yml"
13+
tags:
14+
- "v*"
15+
pull_request:
16+
branches: [master]
17+
paths:
18+
- "**.go"
19+
- "**.js"
20+
- "go.mod"
21+
- "go.sum"
22+
- ".github/workflows/build.yml"
23+
24+
jobs:
25+
build:
26+
runs-on: ubuntu-latest
27+
strategy:
28+
matrix:
29+
goarch: [amd64, arm64]
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- uses: actions/setup-go@v5
34+
with:
35+
go-version: "1.21"
36+
37+
- run: go mod tidy
38+
39+
- name: Build for linux/${{ matrix.goarch }}
40+
env:
41+
GOOS: linux
42+
GOARCH: ${{ matrix.goarch }}
43+
run: go build -o jumpkwapp-linux-${{ matrix.goarch }} ./jumpkwapp.go
44+
45+
- name: Upload binary as artifact
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: jumpkwapp-linux-${{ matrix.goarch }}
49+
path: jumpkwapp-linux-${{ matrix.goarch }}
50+
51+
release:
52+
needs: build
53+
runs-on: ubuntu-latest
54+
if: startsWith(github.ref, 'refs/tags/v')
55+
permissions:
56+
contents: write
57+
steps:
58+
- name: Download all artifacts
59+
uses: actions/download-artifact@v4
60+
61+
- name: Create release
62+
uses: softprops/action-gh-release@v2
63+
with:
64+
files: |
65+
jumpkwapp-linux-amd64/jumpkwapp-linux-amd64
66+
jumpkwapp-linux-arm64/jumpkwapp-linux-arm64

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jumpkwapp

0 commit comments

Comments
 (0)