[devops]github action add arm64 builder

pull/3622/head
jhd2best 4 years ago committed by Leo Chen
parent c6c0511680
commit 060747c0d9
  1. 73
      .github/workflows/ci.yaml

@ -40,11 +40,11 @@ jobs:
if: needs.check.outputs.tag_annotated == 'true'
strategy:
matrix:
os: [ubuntu-18.04, macos-10.15]
os: [ubuntu-18.04, macos-10.15, [self-hosted, linux, ARM64]]
steps:
- name: Import GPG key
id: import_gpg
if: join(matrix.os, '-') != 'self-hosted-linux-ARM64'
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
@ -53,7 +53,7 @@ jobs:
- name: Set up Go 1.14
uses: actions/setup-go@v2
with:
go-version: 1.14.13
go-version: 1.14.14
- name: Checkout dependence repo
uses: actions/checkout@v2
@ -94,12 +94,12 @@ jobs:
mv $HOME/rpmbuild/RPMS/x86_64/harmony-$build_version-$build_release.x86_64.rpm ./bin/
working-directory: harmony
- name: Signed harmony binary
if: matrix.os == 'ubuntu-18.04'
- name: Build harmony binary and packages for Linux
if: join(matrix.os, '-') == 'self-hosted-linux-ARM64'
run: |
gpg --detach-sign harmony-amd64
sha256sum harmony-amd64 >> harmony-amd64.sha256
working-directory: harmony/bin
make linux_static
mv ./bin/harmony ./bin/harmony-arm64
working-directory: harmony
- name: Build harmony binary and packages for MacOS
if: matrix.os == 'macos-10.15'
@ -112,7 +112,6 @@ jobs:
gpg --detach-sign harmony
zip -qr ./harmony-macos.zip ./*
rm -rf `ls * | egrep -v harmony-macos.zip`
shasum -a 256 harmony-macos.zip >> harmony-macos.zip.sha256
working-directory: harmony
- name: Upload artifact
@ -174,12 +173,18 @@ jobs:
harmonyone/harmony:${{ env.build_version }}-${{ env.build_release }}
release-page:
name: Create and publish release page
name: Sign binary and create and publish release page
needs: [check, build]
runs-on: ubuntu-18.04
if: needs.check.outputs.tag_annotated == 'true'
steps:
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v3
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASS }}
- name: Checkout harmony core code
uses: actions/checkout@v2
with:
@ -202,6 +207,20 @@ jobs:
with:
name: harmony
- name: Signed amd64 harmony binary
run: |
gpg --detach-sign harmony-amd64
sha256sum harmony-amd64 >> harmony-amd64.sha256
- name: Signed arm64 harmony binary
run: |
gpg --detach-sign harmony-arm64
sha256sum harmony-arm64 >> harmony-arm64.sha256
- name: Signed amd64 harmony binary
run: |
shasum -a 256 harmony-macos.zip >> harmony-macos.zip.sha256
- name: Get tag message
env:
TAG_SHA: ${{ github.event.after }}
@ -263,7 +282,7 @@ jobs:
asset_name: harmony-amd64
asset_content_type: application/octet-stream
- name: Upload sha256 signature of harmony binary for Linux
- name: Upload sha256 signature of harmony amd64 binary for Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -273,7 +292,7 @@ jobs:
asset_name: harmony-amd64.sha256
asset_content_type: text/plain
- name: Upload gpg signature of harmony binary for Linux
- name: Upload gpg signature of harmony amd64 binary for Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -283,6 +302,36 @@ jobs:
asset_name: harmony-amd64.sig
asset_content_type: application/octet-stream
- name: Upload harmony arm64 binary for Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./harmony-arm64
asset_name: harmony-arm64
asset_content_type: application/octet-stream
- name: Upload sha256 signature of harmony arm64 binary for Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./harmony-arm64.sha256
asset_name: harmony-arm64.sha256
asset_content_type: text/plain
- name: Upload gpg signature of harmony arm64 binary for Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./harmony-arm64.sig
asset_name: harmony-arm64.sig
asset_content_type: application/octet-stream
- name: Upload harmony binary for MacOS
uses: actions/upload-release-asset@v1
env:

Loading…
Cancel
Save