Skip to content

Commit

Permalink
try release artifacts job
Browse files Browse the repository at this point in the history
  • Loading branch information
okdas committed May 9, 2024
1 parent 33bb098 commit ead3046
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 34 deletions.
68 changes: 34 additions & 34 deletions .github/workflows/container-images.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: Create and Push Container Image (heighliner)
# name: Create and Push Container Image (heighliner)

on:
push:
tags:
- "**"
branches:
- "**"
# on:
# push:
# tags:
# - "**"
# branches:
# - "**"

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# jobs:
# build-and-push-image:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write

steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# steps:
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Log in to the Container registry
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: strangelove-ventures/[email protected]
with:
chain: pocket-network
dockerfile: cosmos
platform: linux/arm64,linux/amd64
pre-build: |
make -d heighliner_pre_build
build-target: |
make -d heighliner_build
binaries: |
- /go/bin/poktrolld
# - name: Build and push Docker image
# uses: strangelove-ventures/[email protected]
# with:
# chain: pocket-network
# dockerfile: cosmos
# platform: linux/arm64,linux/amd64
# pre-build: |
# make -d heighliner_pre_build
# build-target: |
# make -d heighliner_build
# binaries: |
# - /go/bin/poktrolld
94 changes: 94 additions & 0 deletions .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Release artifacts

# Currently disabled, but ready to implement a CI job to add binaries to GitHub releases.
on:
push:
branches: ["dk-heighliner"]
# pull_request:

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 binaries
run: make ignite_release

- name: Unarchive linux binaries for Docker to consume
run: 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): 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/

# 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/*

0 comments on commit ead3046

Please sign in to comment.