Skip to content

Commit 69a291e

Browse files
authored
ci: add a ci to build darwin version when add tag (Finschia#180)
* ci: add a ci to build darwin version when release Signed-off-by: zemyblue <[email protected]> * chore: update changelog Signed-off-by: zemyblue <[email protected]> --------- Signed-off-by: zemyblue <[email protected]>
1 parent 6424653 commit 69a291e

File tree

2 files changed

+75
-75
lines changed

2 files changed

+75
-75
lines changed

.github/workflows/release-build.yml

+74-75
Original file line numberDiff line numberDiff line change
@@ -88,66 +88,65 @@ jobs:
8888
./build/finschia-${{ env.ID }}.md5
8989
./build/finschia-${{ env.ID }}.sha256
9090
91-
# build_for_darwin:
92-
# name: "Release Build for macOS"
93-
# needs: create_tarball
94-
# runs-on: macOS-latest
95-
# strategy:
96-
# matrix:
97-
# arch: [ "amd64", "arm64" ]
98-
# include:
99-
# - arch: amd64
100-
# libwasmvm: libwasmvm.dylib
101-
# - arch: arm64
102-
# libwasmvm: libwasmvm.dylib
103-
# steps:
104-
# - name: "Set tag as version"
105-
# run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV # set env.VERSION=v0.0.0
106-
# - name: "Setup Xcode"
107-
# run: sudo xcode-select --switch /Applications/Xcode.app
108-
# - name: "Install md5sum"
109-
# run: |
110-
# brew update
111-
# brew install md5sha1sum
112-
# - name: "Install go"
113-
# uses: actions/setup-go@v3
114-
# with:
115-
# go-version: '1.18'
116-
# check-latest: true
117-
# - name: "Print go environment"
118-
# run: go env
119-
# - name: "Download compressed repository source"
120-
# uses: actions/download-artifact@v3
121-
# with:
122-
# name: release-${{ env.VERSION }}
123-
# - name: "Extract compressed repository source"
124-
# run: tar zxf finschia-${{ env.VERSION }}.tgz --strip-components=1
125-
#
126-
# - name: "Set ID=${{ env.VERSION }}-darwin-${{ matrix.arch }}"
127-
# run: echo "ID=${{ env.VERSION }}-darwin-${{ matrix.arch }}" >> $GITHUB_ENV
128-
# - name: "Build release bundle: darwin-${{ matrix.arch }}"
129-
# run: |
130-
# go env -w GOARCH=${{ matrix.arch }}
131-
# make clean build-release-bundle
132-
# - name: "Create checksum: darwin-${{ matrix.arch }}"
133-
# run: |
134-
# cd ./build
135-
# ls -laF
136-
# md5sum finschia-${{ env.ID }}.tgz > ./finschia-${{ env.ID }}.md5
137-
# shasum -a 256 finschia-${{ env.ID }}.tgz > ./finschia-${{ env.ID }}.sha256
138-
# - name: "Store artifact: darwin-${{ matrix.arch }}"
139-
# uses: actions/upload-artifact@v3
140-
# with:
141-
# name: release-${{ env.VERSION }}
142-
# path: |
143-
# ./build/finschia-${{ env.ID }}.tgz
144-
# ./build/finschia-${{ env.ID }}.md5
145-
# ./build/finschia-${{ env.ID }}.sha256
91+
build_for_darwin:
92+
name: "Release Build for macOS"
93+
needs: create_tarball
94+
runs-on: macOS-latest
95+
strategy:
96+
matrix:
97+
arch: [ "amd64", "arm64" ]
98+
include:
99+
- arch: amd64
100+
libwasmvm: libwasmvm.dylib
101+
- arch: arm64
102+
libwasmvm: libwasmvm.dylib
103+
steps:
104+
- name: "Set tag as version"
105+
run: echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV # set env.VERSION=v0.0.0
106+
- name: "Setup Xcode"
107+
run: sudo xcode-select --switch /Applications/Xcode.app
108+
- name: "Install md5sum"
109+
run: |
110+
brew update
111+
brew install md5sha1sum
112+
- name: "Install go"
113+
uses: actions/setup-go@v3
114+
with:
115+
go-version: '1.18'
116+
check-latest: true
117+
- name: "Print go environment"
118+
run: go env
119+
- name: "Download compressed repository source"
120+
uses: actions/download-artifact@v3
121+
with:
122+
name: release-${{ env.VERSION }}
123+
- name: "Extract compressed repository source"
124+
run: tar zxf finschia-${{ env.VERSION }}.tgz --strip-components=1
125+
126+
- name: "Set ID=${{ env.VERSION }}-darwin-${{ matrix.arch }}"
127+
run: echo "ID=${{ env.VERSION }}-darwin-${{ matrix.arch }}" >> $GITHUB_ENV
128+
- name: "Build release bundle: darwin-${{ matrix.arch }}"
129+
run: |
130+
go env -w GOARCH=${{ matrix.arch }}
131+
make clean build-release-bundle
132+
- name: "Create checksum: darwin-${{ matrix.arch }}"
133+
run: |
134+
cd ./build
135+
ls -laF
136+
md5sum finschia-${{ env.ID }}.tgz > ./finschia-${{ env.ID }}.md5
137+
shasum -a 256 finschia-${{ env.ID }}.tgz > ./finschia-${{ env.ID }}.sha256
138+
- name: "Store artifact: darwin-${{ matrix.arch }}"
139+
uses: actions/upload-artifact@v3
140+
with:
141+
name: release-${{ env.VERSION }}
142+
path: |
143+
./build/finschia-${{ env.ID }}.tgz
144+
./build/finschia-${{ env.ID }}.md5
145+
./build/finschia-${{ env.ID }}.sha256
146146
147147
create_release:
148148
name: "Create Release"
149-
needs: [ build_for_linux ]
150-
# needs: [ build_for_linux, build_for_darwin ]
149+
needs: [ build_for_linux, build_for_darwin ]
151150
runs-on: ubuntu-latest
152151
steps:
153152
- name: "Set tag as version"
@@ -211,24 +210,24 @@ jobs:
211210
asset_path: finschia-${{ env.VERSION }}-linux-arm64.tgz
212211
asset_name: finschia-${{ env.VERSION }}-linux-arm64.tgz
213212
asset_content_type: application/octet-stream
214-
# - name: "Upload artifact: finschia-${{ env.VERSION }}-dawrin-amd64"
215-
# uses: actions/upload-release-asset@v1
216-
# env:
217-
# GITHUB_TOKEN: ${{ github.token }}
218-
# with:
219-
# upload_url: ${{ steps.create_release.outputs.upload_url }}
220-
# asset_path: finschia-${{ env.VERSION }}-darwin-amd64.tgz
221-
# asset_name: finschia-${{ env.VERSION }}-darwin-amd64.tgz
222-
# asset_content_type: application/octet-stream
223-
# - name: "Upload artifact: finschia-${{ env.VERSION }}-dawrin-arm64"
224-
# uses: actions/upload-release-asset@v1
225-
# env:
226-
# GITHUB_TOKEN: ${{ github.token }}
227-
# with:
228-
# upload_url: ${{ steps.create_release.outputs.upload_url }}
229-
# asset_path: finschia-${{ env.VERSION }}-darwin-arm64.tgz
230-
# asset_name: finschia-${{ env.VERSION }}-darwin-arm64.tgz
231-
# asset_content_type: application/octet-stream
213+
- name: "Upload artifact: finschia-${{ env.VERSION }}-dawrin-amd64"
214+
uses: actions/upload-release-asset@v1
215+
env:
216+
GITHUB_TOKEN: ${{ github.token }}
217+
with:
218+
upload_url: ${{ steps.create_release.outputs.upload_url }}
219+
asset_path: finschia-${{ env.VERSION }}-darwin-amd64.tgz
220+
asset_name: finschia-${{ env.VERSION }}-darwin-amd64.tgz
221+
asset_content_type: application/octet-stream
222+
- name: "Upload artifact: finschia-${{ env.VERSION }}-dawrin-arm64"
223+
uses: actions/upload-release-asset@v1
224+
env:
225+
GITHUB_TOKEN: ${{ github.token }}
226+
with:
227+
upload_url: ${{ steps.create_release.outputs.upload_url }}
228+
asset_path: finschia-${{ env.VERSION }}-darwin-arm64.tgz
229+
asset_name: finschia-${{ env.VERSION }}-darwin-arm64.tgz
230+
asset_content_type: application/octet-stream
232231
- name: "Upload artifact: compressed repository source"
233232
uses: actions/upload-release-asset@v1
234233
env:

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
4545
### Breaking Changes
4646

4747
### Build, CI
48+
* (ci) [\#180](https://github.com/Finschia/finschia/pull/180) add a CI to build darwin version when add tag
4849

4950
### Docs
5051

0 commit comments

Comments
 (0)