one change #3
Workflow file for this run
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 Pipeline" | |
on: | |
push: | |
branches: | |
- jesse/pipeline-deploy | |
- main | |
env: | |
PROJECT_ID: "polygonlabs-devtools-dev" | |
GAR_LOCATION: "europe-west2" | |
WIF_PROVIDER: "projects/337907489413/locations/global/workloadIdentityPools/jesse-artifacts-pool/providers/jesse-artifacts" # this was hard to find: WIP --> Expand pool --> Click pencil icon | |
WIF_SERVICE_ACCOUNT: "jesse-artifacts-github-actions@prj-polygonlabs-devtools-dev.iam.gserviceaccount.com" | |
CRITICAL_COUNT: 5 | |
APT_REPOSITORY: "europe-west2-docker.pkg.dev/prj-polygonlabs-devtools-dev/polygonlabs-apt-dev/jesse/polygon-cli" | |
ATTESTOR_PROJECT_ID: "polygonlabs-devtools-dev" | |
KEY_RING: "jesse-artifacts-ring" | |
KEY: "jesse-artifacts-binary-auth-key" | |
ATTESTOR: "jesse-artifacts-attestor" | |
jobs: | |
build-pipeline-apt: | |
name: "Build and upload APT package" | |
permissions: | |
contents: "write" | |
id-token: "write" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Adding TAG to ENV | |
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV | |
- name: Building for amd64 | |
run: make build | |
- name: Making directory structure | |
run: mkdir -p packaging/deb/polycli/usr/bin | |
- name: Copying necessary files | |
run: cp -rp out/polycli packaging/deb/polycli/usr/bin/ | |
- name: Creating package for binary for bor ${{ env.ARCH }} | |
run: cp -rp packaging/deb/polycli packaging/deb/polycli-${{ env.GIT_TAG }}-${{ env.ARCH }} | |
env: | |
ARCH: amd64 | |
- name: Running package build | |
run: dpkg-deb --build --root-owner-group packaging/deb/polycli-${{ env.GIT_TAG }}-${{ env.ARCH }} | |
env: | |
ARCH: amd64 | |
- name: Making a temp directory | |
run: mkdir -p packaging/deb/polycli_temp | |
- name: Renaming x86 binaries for future use | |
run: mv build/bin/bor packaging/deb/bor_temp/bor.amd64 | |
- name: Removing the bor binary | |
run: rm -rf packaging/deb/polycli/usr/bin/polycli | |
####################################### | |
- name: Google Auth | |
id: auth | |
uses: google-github-actions/auth@v2 | |
with: | |
token_format: "access_token" | |
workload_identity_provider: "${{ env.WIF_PROVIDER }}" | |
service_account: "${{ env.WIF_SERVICE_ACCOUNT }}" | |
- name: "Set up Cloud SDK" | |
uses: "google-github-actions/setup-gcloud@v1" | |
- name: Check pwd | |
run: pwd | |
- name: Check files | |
run: ls -ltr packaging/deb/ | grep polycli | |
- id: gcloud | |
name: gcloud | |
run: |- | |
gcloud config set artifacts/repository polygonlabs-apt-dev | |
gcloud config set artifacts/location europe-west2 | |
gcloud config set project prj-polygonlabs-devtools-dev | |
gcloud artifacts apt upload polygonlabs-apt-dev --source=packaging/deb/polycli-${{ env.GIT_TAG }}-${{ env.ARCH }} |