Skip to content

Commit 190475c

Browse files
committed
ci: release to gh
1 parent 5318463 commit 190475c

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

.github/workflows/build-dev.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ on:
1313

1414
jobs:
1515
build-dev:
16-
name: ${{ matrix.targets.target }}@${{ matrix.targets.os }}
16+
name: ${{ matrix.targets.alias }}
1717
runs-on: ${{ matrix.targets.os }}
1818

1919
strategy:
2020
fail-fast: false
2121
matrix:
2222
targets:
23-
- { os: macos-11 , target: aarch64-apple-darwin }
24-
- { os: macos-12 , target: aarch64-apple-darwin }
25-
- { os: ubuntu-20.04, target: x86_64-unknown-linux-gnu }
26-
- { os: ubuntu-22.04, target: x86_64-unknown-linux-gnu }
27-
- { os: windows-2019, target: x86_64-pc-windows-msvc }
28-
- { os: windows-2022, target: x86_64-pc-windows-msvc }
23+
- { os: macos-11 , target: aarch64-apple-darwin , alias: aarch64-macos-11 }
24+
- { os: macos-12 , target: aarch64-apple-darwin , alias: aarch64-macos-12 }
25+
- { os: ubuntu-20.04, target: x86_64-unknown-linux-gnu, alias: amd64-ubuntu-2004 }
26+
- { os: ubuntu-22.04, target: x86_64-unknown-linux-gnu, alias: amd64-ubuntu-2204 }
27+
- { os: windows-2019, target: x86_64-pc-windows-msvc , alias: amd64-windows-2019 }
28+
- { os: windows-2022, target: x86_64-pc-windows-msvc , alias: amd64-windows-2022 }
2929

3030
steps:
3131
- name: Checkout
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setup rust cache
5858
uses: Swatinem/rust-cache@v2
5959
with:
60-
prefix-key: ${{ matrix.targets.target }}@${{ matrix.targets.os }}
60+
prefix-key: ${{ matrix.targets.alias }}
6161

6262
- name: Generate version
6363
id: gen-version
@@ -84,7 +84,7 @@ jobs:
8484
- name: Generate artifacts name
8585
id: gen-name
8686
shell: bash
87-
run: echo 'NAME=${{ matrix.targets.target }}@${{ matrix.targets.os }}' >> $GITHUB_OUTPUT
87+
run: echo 'NAME=dev-${{ matrix.targets.alias }}' >> $GITHUB_OUTPUT
8888

8989
- name: Generate binary extension
9090
id: gen-ext
@@ -96,5 +96,5 @@ jobs:
9696
uses: actions/upload-artifact@v3
9797
with:
9898
name: ${{ steps.gen-name.outputs.NAME }}
99-
path: './target/${{ matrix.targets.target }}/debug/cnb${{ steps.gen-ext.outputs.EXT }}'
99+
path: ./target/${{ matrix.targets.target }}/debug/cnb${{ steps.gen-ext.outputs.EXT }}
100100
if-no-files-found: error

.github/workflows/build-release.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ on:
77

88
jobs:
99
build-release:
10-
name: ${{ matrix.targets.target }}@${{ matrix.targets.os }}
10+
name: ${{ matrix.targets.alias }}
1111
runs-on: ${{ matrix.targets.os }}
1212

1313
strategy:
1414
fail-fast: false
1515
matrix:
1616
targets:
17-
- { os: macos-11 , target: aarch64-apple-darwin }
18-
- { os: macos-12 , target: aarch64-apple-darwin }
19-
- { os: ubuntu-20.04, target: x86_64-unknown-linux-gnu }
20-
- { os: ubuntu-22.04, target: x86_64-unknown-linux-gnu }
21-
- { os: windows-2019, target: x86_64-pc-windows-msvc }
22-
- { os: windows-2022, target: x86_64-pc-windows-msvc }
17+
- { os: macos-11 , target: aarch64-apple-darwin , alias: aarch64-macos-11 }
18+
- { os: macos-12 , target: aarch64-apple-darwin , alias: aarch64-macos-12 }
19+
- { os: ubuntu-20.04, target: x86_64-unknown-linux-gnu, alias: amd64-ubuntu-2004 }
20+
- { os: ubuntu-22.04, target: x86_64-unknown-linux-gnu, alias: amd64-ubuntu-2204 }
21+
- { os: windows-2019, target: x86_64-pc-windows-msvc , alias: amd64-windows-2019 }
22+
- { os: windows-2022, target: x86_64-pc-windows-msvc , alias: amd64-windows-2022 }
2323

2424
steps:
2525
- name: Checkout
@@ -43,7 +43,7 @@ jobs:
4343
- name: Setup rust cache
4444
uses: Swatinem/rust-cache@v2
4545
with:
46-
prefix-key: ${{ matrix.targets.target }}@${{ matrix.targets.os }}
46+
prefix-key: ${{ matrix.targets.alias }}
4747

4848
- name: Generate version
4949
id: gen-version
@@ -64,7 +64,7 @@ jobs:
6464
- name: Generate artifacts name
6565
id: gen-name
6666
shell: bash
67-
run: echo 'NAME=${{ matrix.targets.target }}@${{ matrix.targets.os }}' >> $GITHUB_OUTPUT
67+
run: echo 'NAME=release-${{ matrix.targets.alias }}' >> $GITHUB_OUTPUT
6868

6969
- name: Generate binary extension
7070
id: gen-ext
@@ -76,5 +76,11 @@ jobs:
7676
uses: actions/upload-artifact@v3
7777
with:
7878
name: ${{ steps.gen-name.outputs.NAME }}
79-
path: './target/${{ matrix.targets.target }}/release/cnb${{ steps.gen-ext.outputs.EXT }}'
79+
path: ./target/${{ matrix.targets.target }}/release/cnb${{ steps.gen-ext.outputs.EXT }}
8080
if-no-files-found: error
81+
82+
- name: Create github release
83+
uses: softprops/action-gh-release@v1
84+
with:
85+
files: ./target/${{ matrix.targets.target }}/release/cnb${{ steps.gen-ext.outputs.EXT }}
86+

0 commit comments

Comments
 (0)