Skip to content

Commit b538854

Browse files
committed
Add macOS release binary
1 parent bbf9d2b commit b538854

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

.github/workflows/release.yml

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Release
2+
13
on:
24
push:
35
# Sequence of patterns matched against refs/tags
@@ -20,7 +22,7 @@ jobs:
2022
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2123
with:
2224
tag_name: ${{ steps.get_version.outputs.VERSION }}
23-
release_name: Release ${{ steps.get_version.outputs.VERSION }}
25+
release_name: ckb-debugger ${{ steps.get_version.outputs.VERSION }}
2426
draft: false
2527
prerelease: false
2628
- name: Output upload URL file
@@ -75,3 +77,48 @@ jobs:
7577
asset_path: ckb-debugger-linux-x64-sha256.txt
7678
asset_name: ckb-debugger-linux-x64-sha256.txt
7779
asset_content_type: text/plain
80+
81+
publish-macos:
82+
name: Publish binary on macOS
83+
needs: [release]
84+
runs-on: macos-latest
85+
steps:
86+
- name: Load upload URL file
87+
uses: actions/download-artifact@v1
88+
with:
89+
name: upload_url
90+
- name: Get upload URL
91+
id: get_upload_url
92+
run: |
93+
value=`cat upload_url/upload_url.txt`
94+
echo ::set-output name=upload_url::$value
95+
env:
96+
TAG_REF_NAME: ${{ github.ref }}
97+
REPOSITORY_NAME: ${{ github.repository }}
98+
- uses: actions/checkout@v2
99+
- name: Build
100+
run: cd bins && cargo build --release
101+
- name: Archive files
102+
run: tar -cvzf ckb-debugger-macos-x64.tar.gz bins/target/release/ckb-debugger LICENSE
103+
- name: Generate checksum
104+
run: sha256sum ckb-debugger-macos-x64.tar.gz > ckb-debugger-macos-x64-sha256.txt
105+
- name: Upload binary
106+
id: upload-release-binary
107+
uses: actions/upload-release-asset@v1
108+
env:
109+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110+
with:
111+
upload_url: ${{ steps.get_upload_url.outputs.upload_url }}
112+
asset_path: ckb-debugger-macos-x64.tar.gz
113+
asset_name: ckb-debugger-macos-x64.tar.gz
114+
asset_content_type: application/tar+gzip
115+
- name: Upload checksum
116+
id: upload-release-checksum
117+
uses: actions/upload-release-asset@v1
118+
env:
119+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120+
with:
121+
upload_url: ${{ steps.get_upload_url.outputs.upload_url }}
122+
asset_path: ckb-debugger-macos-x64-sha256.txt
123+
asset_name: ckb-debugger-macos-x64-sha256.txt
124+
asset_content_type: text/plain

0 commit comments

Comments
 (0)