-
Notifications
You must be signed in to change notification settings - Fork 13
97 lines (84 loc) · 3.28 KB
/
release-artifacts.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
88
89
90
91
92
93
94
95
96
97
name: Release artifacts
on:
push:
branches: ["main"]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
go-test:
runs-on: ubuntu-latest
steps:
- name: install ignite
# TODO_TECHDEBT: upgrade to the latest Ignite (the latest at the moment of creating a note is 0.28). Need to downgrade to fix CI pipelines. Might be done in scope of #240.
run: |
# curl https://get.ignite.com/cli! | bash
wget https://github.com/ignite/cli/releases/download/v28.2.0/ignite_28.2.0_linux_amd64.tar.gz
tar -xzf ignite_28.2.0_linux_amd64.tar.gz
sudo mv ignite /usr/local/bin/ignite
ignite version
- uses: actions/checkout@v3
with:
fetch-depth: "0" # Per https://github.com/ignite/cli/issues/1674#issuecomment-1144619147
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21.6"
- name: Install CI dependencies
run: make install_ci_deps
- name: Generate protobufs
run: make proto_regen
- name: Generate mocks
run: make go_mockgen
- name: Build binaries
run: ignite chain build --release -t=linux:amd64 -t=linux:arm64 -t=windows:amd64 -t=windows:arm64 -t=darwin:arm64 -t=darwin:amd64 --debug
- name: Unarchive linux binaries for Docker to consume
run: |
mkdir -p release_linux_amd64 && tar -zxvf release/poktroll_linux_amd64.tar.gz -C $_
mkdir -p release_linux_arm64 && tar -zxvf release/poktroll_linux_arm64.tar.gz -C $_
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# TODO(@okdas): switch to this method of building production images, as this is a quick way to build multi-arch
# images, reusing binaries pre-built by Ignite.
# - name: Docker Metadata action
# id: meta
# uses: docker/metadata-action@v5
# env:
# DOCKER_METADATA_PR_HEAD_SHA: "true"
# with:
# images: |
# ghcr.io/pokt-network/poktrolld
# tags: |
# type=ref,event=tag
# type=sha
# type=sha,format=long
# - name: Login to GitHub Container Registry
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Build and push Docker image
# uses: docker/build-push-action@v5
# with:
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# platforms: linux/amd64,linux/arm64
# file: Dockerfile
# cache-from: type=gha
# cache-to: type=gha,mode=max
# context: .
# TODO(@okdas): when we have proper releases, we can remove this and use binaries built by releases instead.
# But for now, attach them to commits so we/community can access them
- name: Add binaries to commit
uses: actions/upload-artifact@v4
with:
name: poktrolld
path: release/*
- name: Add release and publish binaries
uses: softprops/action-gh-release@v1
with:
files: |
release/*