-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' into feat/repair-cancel
- Loading branch information
Showing
12 changed files
with
251 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Build & Push Normal Wasm | ||
|
||
concurrency: | ||
group: "build-release-wasm-${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
# branches: [ master, staging, qa ] | ||
tags: | ||
- 'v*.*.*' | ||
# pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-wasm: | ||
name: Build-wasm | ||
runs-on: [self-hosted, arc-runner] | ||
outputs: | ||
build_version: ${{ steps.wasm_build.outputs.BUILD_TAG }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build wasm binary using go version 1.22.5 | ||
id: wasm_build | ||
run: | | ||
docker run --rm -v $PWD:/gosdk -w /gosdk golang:1.22.5 sh -c "git config --global --add safe.directory /gosdk; make wasm-build" | ||
BUILD_TAG=zcn-$(git describe --tags --exact-match)-normal.wasm | ||
BUILD_TAG="${BUILD_TAG:0:4}${BUILD_TAG:5}" | ||
mv zcn.wasm $BUILD_TAG | ||
echo "BUILD_TAG=$BUILD_TAG" >>$GITHUB_OUTPUT | ||
- name: 'Upload Artifact' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ steps.wasm_build.outputs.BUILD_TAG }} | ||
path: ${{ steps.wasm_build.outputs.BUILD_TAG }} | ||
|
||
- name: Install AWS cli | ||
run: | | ||
sudo apt update -y | ||
sudo apt install awscli -y | ||
- name: Copy the wasm binary to aws s3. | ||
run: | | ||
export AWS_ACCESS_KEY_ID=${{ secrets.WEBAPP_STATIC_ACCESS_KEY }} | ||
export AWS_SECRET_ACCESS_KEY=${{ secrets.WEBAPP_STATIC_SECRET_ACCESS_KEY }} | ||
export AWS_DEFAULT_REGION=${{ secrets.WEBAPP_STATIC_REGION }} | ||
gzip -9 ${{ steps.wasm_build.outputs.BUILD_TAG }} && mv ${{ steps.wasm_build.outputs.BUILD_TAG }}.gz ${{ steps.wasm_build.outputs.BUILD_TAG }} | ||
aws s3 cp ${{ steps.wasm_build.outputs.BUILD_TAG }} s3://${{ secrets.WEBAPP_STATIC_BUCKET }}/wasm/${{ steps.wasm_build.outputs.BUILD_TAG }} --content-encoding gzip | ||
- name: Invalidate wasm binary | ||
run: | | ||
export AWS_ACCESS_KEY_ID=${{ secrets.WEBAPP_STATIC_ACCESS_KEY }} | ||
export AWS_SECRET_ACCESS_KEY=${{ secrets.WEBAPP_STATIC_SECRET_ACCESS_KEY }} | ||
export AWS_DEFAULT_REGION=${{ secrets.WEBAPP_STATIC_REGION }} | ||
aws cloudfront create-invalidation --distribution-id ${{ secrets.WEBAPP_STATIC_DISTRIBUTION_ID }} --paths '/wasm/*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Build-and-release-wasm | ||
|
||
concurrency: | ||
group: "build-release-wasm-${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
# branches: [ master, staging, qa ] | ||
tags: | ||
- 'v*.*.*' | ||
# pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GOSDK }} | ||
|
||
jobs: | ||
build-wasm: | ||
name: Build-wasm | ||
runs-on: [self-hosted, arc-runner] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
# - name: Set up Go 1.23 | ||
# uses: actions/setup-go@v3 | ||
# with: | ||
# go-version: 1.23 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get -y install build-essential nghttp2 libnghttp2-dev libssl-dev wget | ||
- name: Build | ||
run: | | ||
docker run --rm -v $PWD:/gosdk -w /gosdk golang:1.23 make wasm-build | ||
ls -lha | ||
CURRENT_TAG=$(git describe --tags --exact-match) | ||
mv zcn.wasm zcn-${CURRENT_TAG}-normal.wasm | ||
ls -lha | ||
# - name: 'Upload Artifact' | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: zcn.wasm | ||
# path: zcn.wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters