Skip to content

use variables

use variables #31

Workflow file for this run

name: "Build Pipeline"
on:
push:
branches:
- jesse/pipeline-deploy
- main
env:
PROJECT_ID: "prj-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"
APT_REPOSITORY: "polygonlabs-apt-dev"
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: Copying control file
run: |
VERSION="0-${{ github.sha }}"
cp -rp packaging/templates/package_scripts/control packaging/deb/polycli/DEBIAN/control
sed -i "s/^Version: .*/Version: $VERSION/" packaging/deb/polycli/DEBIAN/control
- name: Creating package for binary for polycli ${{ env.ARCH }}
run: cp -rp packaging/deb/polycli packaging/deb/polycli-${{ env.GIT_TAG }}-${{ env.ARCH }}-${{ github.sha }}
env:
ARCH: amd64
- name: Running package build
run: dpkg-deb --build --root-owner-group packaging/deb/polycli-${{ env.GIT_TAG }}-${{ env.ARCH }}-${{ github.sha }}
env:
ARCH: 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 ${{ env.APT_REPOSITORY }}
gcloud config set artifacts/location ${{ env.GAR_LOCATION }}
gcloud config set project ${{ env.PROJECT_ID }}
gcloud artifacts apt upload polygonlabs-apt-dev --source=packaging/deb/polycli-${{ env.GIT_TAG }}-${{ env.ARCH }}-${{ github.sha }}.deb
env:
ARCH: amd64