-
Notifications
You must be signed in to change notification settings - Fork 40
87 lines (68 loc) · 2.77 KB
/
build-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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
- 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 }}