Skip to content

Commit ed696fe

Browse files
authored
ci: release cross platform
1 parent c8d7843 commit ed696fe

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

.github/workflows/myaction.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,39 @@ on:
44
workflow_dispatch:
55

66
jobs:
7-
build-hello-world:
7+
create-release:
88
permissions: write-all
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
12+
- name: Create Release
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
run: gh release create ${{ github.ref_name }} --generate-notes --title "Version ${{ github.ref_name }}"
16+
17+
build-hello-world:
18+
needs: create-release
19+
permissions: write-all
1220

13-
- name: compile and run
14-
run: g++ hello_world.cpp -o hello_world_linux
21+
strategy:
22+
matrix:
23+
include:
24+
- os: ubuntu-latest
25+
file_name: hello_world_linux
26+
- os: macos-latest
27+
file_name: hello_world_mac
28+
- os: windows-latest
29+
file_name: hello_world_windows.exe
1530

16-
- name: Create Release
31+
runs-on: ${{ matrix.os }}
32+
name: ${{ matrix.os }}
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
- name: compile
37+
run: g++ hello_world.cpp -o ${{ matrix.file_name }}
38+
39+
- name: Update Release
1740
env:
1841
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19-
run: >-
20-
gh release create ${{ github.ref_name }}
21-
"hello_world_linux"
22-
--generate-notes
23-
--title "Version ${{ github.ref_name }}"
42+
run: gh release upload ${{ github.ref_name }} "${{ matrix.file_name}}"

0 commit comments

Comments
 (0)