-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Release artifacts job: binaries and containers (#523)
- Loading branch information
Showing
11 changed files
with
174 additions
and
33 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Release artifacts | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
release-artifacts: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: "0" # Per https://github.com/ignite/cli/issues/1674#issuecomment-1144619147 | ||
|
||
- name: install ignite | ||
run: | | ||
make ignite_install | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.22.2" | ||
|
||
- 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 and extract binaries for container build | ||
run: | | ||
make ignite_update_ldflags | ||
make ignite_release | ||
make ignite_release_extract_binaries | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- 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=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=ref,event=tag,suffix=-prod | ||
type=sha,suffix=-prod | ||
type=sha,format=long,suffix=-prod | ||
- 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.release | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
context: . | ||
|
||
# TODO(@okdas): use for releases (also change the "on" part at the top so it only tgirrered for tags/releases) | ||
- name: Add release and publish binaries | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
release/* |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Run `asdf plugin add golang` and `asdf install` to install the dependencies, | ||
# and `asdf current` to switch to the versions of dependencies listed below | ||
golang 1.21.6 | ||
go 1.21.6 | ||
golang 1.22.2 | ||
go 1.22.2 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# This Dockerfile is used to build container image for production workloads. | ||
# It relies on the binaries produced by `ignite_release` and `ignite_release_extract_binaries` make targets. | ||
FROM alpine:3.19 | ||
ARG TARGETARCH | ||
|
||
# Use `1025` G/UID so users can switch between this and `heighliner` image without a need to chown the files. | ||
RUN addgroup --gid 1025 -S pocket && adduser --uid 1025 -S pocket -G pocket | ||
|
||
COPY --chown=pocket:pocket release_binaries/poktroll_linux_$TARGETARCH /bin/poktrolld | ||
|
||
USER pocket | ||
|
||
ENTRYPOINT ["poktrolld"] |
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
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
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