Skip to content

Commit c8d6917

Browse files
author
Geniucker
committed
ci: add release
1 parent 416043d commit c8d6917

File tree

4 files changed

+65
-6
lines changed

4 files changed

+65
-6
lines changed

.github/workflows/build_linux.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
name: Build - Linux
22

33
on:
4-
- push
4+
push:
5+
branches:
6+
- main
7+
workflow_call:
58

69
jobs:
710
build:
11+
if: github.repository == 'iOSRealRun-cli/iOSRealRun-cli'
812
strategy:
913
matrix:
1014
os: [ubuntu-latest]
@@ -49,6 +53,6 @@ jobs:
4953
- name: Upload Artifacts
5054
uses: actions/upload-artifact@v3
5155
with:
52-
name: ${{ runner.os }} - ${{ matrix.arch }} Build
56+
name: iOSRealRun-cli-${{ runner.os }}-${{ matrix.arch }}
5357
path: |
5458
output/

.github/workflows/build_macos.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
name: Build - MacOS
22

33
on:
4-
- push
4+
push:
5+
branches:
6+
- main
7+
workflow_call:
58

69
jobs:
710
build:
11+
if: github.repository == 'iOSRealRun-cli/iOSRealRun-cli'
812
strategy:
913
matrix:
1014
os: [macos-latest]
@@ -50,6 +54,6 @@ jobs:
5054
- name: Upload Artifacts
5155
uses: actions/upload-artifact@v3
5256
with:
53-
name: ${{ runner.os }} - ${{ matrix.arch }} Build
57+
name: iOSRealRun-cli-${{ runner.os }}-${{ matrix.arch }}
5458
path: |
5559
output/

.github/workflows/build_win.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
name: Build - Windows
22

33
on:
4-
- push
4+
push:
5+
branches:
6+
- main
7+
workflow_call:
58

69
jobs:
710
build:
11+
if: github.repository == 'iOSRealRun-cli/iOSRealRun-cli'
812
strategy:
913
matrix:
1014
os: [windows-latest]
@@ -49,6 +53,6 @@ jobs:
4953
- name: Upload Artifacts
5054
uses: actions/upload-artifact@v3
5155
with:
52-
name: ${{ runner.os }} - ${{ matrix.arch }} Build
56+
name: iOSRealRun-cli-${{ runner.os }}-${{ matrix.arch }}
5357
path: |
5458
output/

.github/workflows/release.yml

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

0 commit comments

Comments
 (0)