add getConfig endpoint #2106
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
name: Build | |
on: | |
push: | |
workflow_call: | |
inputs: | |
tag_name: | |
type: string | |
draft: | |
type: string | |
prerelease: | |
type: string | |
generate_release_notes: | |
type: string | |
jobs: | |
build: | |
name: build | |
# The build job has a matrix strategy, which means it will run multiple times with different combinations of the os, arch, and target variables. | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# The first combination is Ubuntu running on an AMD64 processor, building for Windows. | |
- os: ubuntu-latest | |
arch: amd64 | |
target: windows | |
ext: .exe | |
cc: x86_64-w64-mingw32-gcc | |
ldflags: "-H windowsgui" | |
# The second combination is Ubuntu running on an AMD64 processor, building for Linux. | |
- os: ubuntu-22.04 | |
arch: amd64 | |
target: linux | |
# The third combination is macOS running on an AMD64 processor, building for Darwin (macOS). | |
- os: macos-13 | |
arch: amd64 | |
target: darwin | |
cgo_ldflags: "-framework UniformTypeIdentifiers -F /System/Library/Frameworks" | |
# The fourth combination is macOS running on an ARM64 processor, building for Darwin (macOS). | |
- os: macos-13 | |
arch: arm64 | |
target: darwin | |
cgo_ldflags: "-framework UniformTypeIdentifiers -F /System/Library/Frameworks" | |
# The build job runs on the specified operating system. | |
runs-on: ${{ matrix.os }} | |
env: | |
TARGET_NAME: wallet-plugin_${{ matrix.target }}-${{ matrix.arch }} | |
GOOS: ${{ matrix.target }} | |
GOARCH: ${{ matrix.arch }} | |
CGO_ENABLED: 1 | |
CC: ${{ matrix.cc }} | |
CGO_LDFLAGS: ${{ matrix.cgo_ldflags }} | |
TAG: ${{ inputs.tag_name }} | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: ./.github/actions/install | |
with: | |
os: ${{ matrix.os }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build binary for ${{ matrix.target }} ${{ matrix.arch }} | |
if: matrix.target != 'darwin' | |
shell: bash | |
run: | | |
TAGS="desktop,production" | |
if [ "${{ matrix.target }}" == "linux" ]; then | |
TAGS="$TAGS,webkit2_41" | |
fi | |
go build -tags "$TAGS" -ldflags "-w -s ${{ matrix.ldflags }}" -o $TARGET_NAME${{ matrix.ext }} main.go | |
- name: Build binary for MacOS ${{ matrix.arch }} | |
if: matrix.target == 'darwin' | |
shell: bash | |
run: | | |
task build | |
chmod +x build/bin/*/Contents/MacOS/* | |
ditto -c -k build/bin/wallet-plugin.app wallet-plugin.app.zip | |
- name: Sign Windows binary | |
if: matrix.target == 'windows' | |
uses: massalabs/station/.github/actions/sign-file@3dac9091bcbe6db4facec2c0f30292f56c11098e | |
with: | |
file: $TARGET_NAME${{ matrix.ext }} | |
GCP_PEM_KEY: ${{ vars.GCP_PEM_KEY }} | |
GCP_KEYSTORE_ID: ${{ vars.GCP_KEYSTORE_ID }} | |
GCP_KEY_ALIAS: ${{ vars.GCP_KEY_ALIAS }} | |
GCP_WORKLOAD_IDENTITY_PROVIDER: ${{ vars.GCP_WORKLOAD_IDENTITY_PROVIDER }} | |
GCP_SERVICE_ACCOUNT: ${{ vars.GCP_SERVICE_ACCOUNT }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.TARGET_NAME }} | |
path: | | |
wallet-plugin* | |
wallet.svg | |
manifest.json | |
- name: Zip binary | |
if: ${{ (matrix.target != 'darwin') && (inputs.tag_name != '') }} | |
run: zip $TARGET_NAME.zip $TARGET_NAME${{ matrix.ext }} wallet.svg manifest.json | |
- name: Zip binary for darwin | |
if: ${{ (matrix.target == 'darwin') && (inputs.tag_name != '') }} | |
run: zip $TARGET_NAME.zip wallet-plugin.app.zip wallet.svg manifest.json | |
- name: Create release and upload binaries | |
if: ${{ inputs.tag_name != '' }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
target_commitish: ${{ github.sha }} | |
tag_name: ${{ inputs.tag_name }} | |
draft: ${{ inputs.draft }} | |
prerelease: ${{ inputs.prerelease }} | |
generate_release_notes: ${{ inputs.generate_release_notes }} | |
files: ${{ env.TARGET_NAME }}.zip | |
- name: Configure AWS credentials | |
if: ${{ inputs.tag_name != '' }} | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-region: eu-west-3 | |
aws-access-key-id: ${{ secrets.MS_S3_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.MS_S3_SECRET_ACCESS_KEY }} | |
- name: s3 Upload | |
if: ${{ inputs.tag_name != '' }} | |
env: | |
AWS3: ${{ vars.MS_S3_BUCKET }} | |
run: aws s3 cp $TARGET_NAME.zip s3://${AWS3}/plugins/wallet/${TAG}/${TARGET_NAME}.zip |