Skip to content

Commit d145e0e

Browse files
author
Geniucker
committed
ci: release
1 parent 0c372e6 commit d145e0e

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build
33
on:
44
push:
55
branches:
6-
- go
6+
- main
77
workflow_call:
88

99
jobs:

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
7+
permissions: write-all
8+
9+
jobs:
10+
build:
11+
uses: ./.github/workflows/build.yml
12+
release:
13+
needs:
14+
- build
15+
runs-on: ubuntu-latest
16+
if: github.repository == 'iOSRealRun-cli/iOSRealRun-cli'
17+
steps:
18+
- name: Checkout codebase
19+
uses: actions/checkout@v3
20+
- name: Download artifacts
21+
uses: actions/download-artifact@v3
22+
- name: zip
23+
run: |
24+
for dir in iOSRealRun-cli*; do
25+
if [ -d "$dir" ]; then
26+
echo "------ Zip $dir ----------"
27+
(cd $dir && zip -r9 "$dir".zip ./* && mv "$dir".zip ../)
28+
fi
29+
done
30+
- name: Display structure of downloaded files
31+
run: ls -R
32+
- name: Upload Release
33+
if: github.event_name == 'release'
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
run: |
37+
for file in iOSRealRun-cli*.zip; do
38+
if [ -f "$file" ]; then
39+
echo "------ Upload $file ----------"
40+
gh release upload ${{ github.event.release.tag_name }} "$file"
41+
fi
42+
done

0 commit comments

Comments
 (0)