Skip to content

Commit 10cf952

Browse files
committed
feat: publish bins
1 parent ae38647 commit 10cf952

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ on:
55
tags:
66
- "v*"
77

8-
env:
9-
BINARY_NAME: commit-boost
10-
118
permissions:
129
contents: write
1310
packages: write
@@ -16,6 +13,20 @@ jobs:
1613
build-binaries:
1714
strategy:
1815
matrix:
16+
target:
17+
[
18+
x86_64-unknown-linux-gnu,
19+
x86_64-pc-windows-gnu,
20+
x86_64-apple-darwin,
21+
aarch64-apple-darwin,
22+
]
23+
names:
24+
- binary: commit-boost
25+
publish: commit-boost-cli
26+
- binary: default-pbs
27+
publish: commit-boost-pbs
28+
- binary: signer-module
29+
publish: commit-boost-signer
1930
include:
2031
- target: x86_64-unknown-linux-gnu
2132
os: ubuntu-latest
@@ -53,28 +64,28 @@ jobs:
5364
uses: actions-rs/cargo@v1
5465
with:
5566
command: build
56-
args: --release --target ${{ matrix.target }} --bin ${{ env.BINARY_NAME }}
67+
args: --release --target ${{ matrix.target }} --bin ${{ matrix.names.binary }}
5768
env:
5869
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: gcc
5970

6071
- name: Package binary (Unix)
6172
if: runner.os != 'Windows'
6273
run: |
6374
cd target/${{ matrix.target }}/release
64-
tar -czvf ${{ env.BINARY_NAME }}-${{ github.ref_name }}-${{ matrix.target }}.tar.gz ${{ env.BINARY_NAME }}
65-
mv ${{ env.BINARY_NAME }}-${{ github.ref_name }}-${{ matrix.target }}.tar.gz ../../../
75+
tar -czvf ${{ matrix.names.publish }}-${{ github.ref_name }}-${{ matrix.target }}.tar.gz ${{ matrix.names.binary }}
76+
mv ${{ matrix.names.publish }}-${{ github.ref_name }}-${{ matrix.target }}.tar.gz ../../../
6677
6778
- name: Package binary (Windows)
6879
if: runner.os == 'Windows'
6980
run: |
7081
cd target/${{ matrix.target }}/release
71-
7z a ${{ env.BINARY_NAME }}-${{ github.ref_name }}-${{ matrix.target }}.zip ${{ env.BINARY_NAME }}.exe
72-
move ${{ env.BINARY_NAME }}-${{ github.ref_name }}-${{ matrix.target }}.zip ../../../
82+
7z a ${{ matrix.names.publish }}-${{ github.ref_name }}-${{ matrix.target }}.zip ${{ matrix.names.binary }}.exe
83+
move ${{ matrix.names.publish }}-${{ github.ref_name }}-${{ matrix.target }}.zip ../../../
7384
7485
- name: Upload binary to release
7586
uses: softprops/action-gh-release@v2
7687
with:
77-
files: ${{ env.BINARY_NAME }}-${{ github.ref_name }}-${{ matrix.target }}.${{ runner.os == 'Windows' && 'zip' || 'tar.gz' }}
88+
files: ${{ matrix.names.publish }}-${{ github.ref_name }}-${{ matrix.target }}.${{ runner.os == 'Windows' && 'zip' || 'tar.gz' }}
7889
draft: true
7990
token: ${{ secrets.GITHUB_TOKEN }}
8091

0 commit comments

Comments
 (0)