-
Notifications
You must be signed in to change notification settings - Fork 16
97 lines (83 loc) · 2.38 KB
/
Copy pathbuild.yaml
File metadata and controls
97 lines (83 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Release Build and Publish
on:
push:
tags:
- '*'
env:
TARGET_REPO: devlikeapro/gows-plus
PROTO_SRC_DIR: proto
jobs:
build-binaries:
name: Build Binaries (${{ matrix.platform }})
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- runner: 'ubuntu-latest'
platform: 'x64'
binary_name: 'gows-amd64'
- runner: 'ubuntu-24.04-arm'
platform: 'arm64'
binary_name: 'gows-arm64'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build
run: |
docker build -t gows .
- name: Copy binary to release directory
run: |
docker create --name temp-gows gows
mkdir -p .bin
docker cp temp-gows:/release/gows ./.bin/gows
docker rm temp-gows
mkdir -p release
mv ./.bin/gows release/${{ matrix.binary_name }}
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: binary-${{ matrix.platform }}
path: release/${{ matrix.binary_name }}
retention-days: 1
collect-proto:
name: Collect Proto Files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Upload proto artifact
uses: actions/upload-artifact@v4
with:
name: proto
path: proto/
retention-days: 1
publish-release:
name: Publish Release
needs: [ build-binaries, collect-proto ]
runs-on: ubuntu-latest
env:
RELEASE_TAG: ${{ github.ref_name }}
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Setup GitHub CLI
env:
CLI_GH_TOKEN: ${{ secrets.TARGET_REPO_TOKEN }}
run: |
gh auth login --with-token <<< "$CLI_GH_TOKEN"
gh config set prompt disabled
# - name: Create new release
# run: |
# gh release create "$RELEASE_TAG" \
# --repo "$TARGET_REPO" \
# --title "$RELEASE_TAG"
- name: Upload release assets
run: |
find artifacts -type f -print0 | while IFS= read -r -d '' file; do
gh release upload "$RELEASE_TAG" \
--repo "$TARGET_REPO" \
--clobber \
"$file"
done