Skip to content

Commit

Permalink
fix: release ci
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyasbhat0 committed Dec 19, 2024
1 parent a28d8a3 commit e0f8c52
Show file tree
Hide file tree
Showing 9 changed files with 372 additions and 215 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release-tesnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
release:
types: [published]

jobs:
release:
name: ${{ matrix.release }}
runs-on: ubuntu-latest
strategy:
matrix:
release: ["release-testnet","release-testnet-cross","sentinel-testnet-release","sentinel-testnet-cross","directory-testnet","directory-testnet-cross"]

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}

- name: ${{ matrix.release }}
env:
RELEASE: true
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: make ${{ matrix.release }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
release: ["release", "release-cross","release-testnet","release-testnet-cross","sentinel-release","sentinel-release-cross","sentinel-testnet-release","sentinel-testnet-cross","directory-release","directory-release-cross","directory-testnet","directory-testnet-cross"]
release: ["release", "release-cross","sentinel-release","sentinel-release-cross","directory-release","directory-release-cross"]

steps:
- name: Checkout
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Contains all the PRs that improved the code without changing the behaviors.
- Fixed ws client issue with event stream
- Fixed swagger issue
- Docker files and scripts
- Go releaser for binary and docker

# v1.0.2-Prerelease

Expand Down
107 changes: 62 additions & 45 deletions releaser/.goreleaser-cross.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,104 +88,121 @@ builds:
- '{{ .Env.BUILD_TAG }}'

universal_binaries:
- id: arkeod-darwin-all
- id: arkeod-darwin-universal
ids:
- arkeod-darwin-amd64
- arkeod-darwin-arm64
replace: false
name_template: "{{ .ProjectName }}d{{ if eq .Env.BUILD_TAG \"testnet\" }}_testnet{{ end }}"

release:
skip_upload: '{{ if eq .Env.RELEASE "true" }}false{{else}}true{{end}}'
name_template: >-
{{ .ProjectName }}d_{{ .Version }}_darwin_universal
{{- if eq .Env.BUILD_TAG "testnet" }}_testnet{{ end }}
archives:
- id: w/version
builds:
- arkeod-linux-arm64
- arkeod-darwin-amd64
- arkeod-darwin-arm64
- arkeod-darwin-all
name_template: "{{ .ProjectName }}d_v{{ .Version }}_{{ .Os }}{{ .Arch }}{{ if eq .Env.BUILD_TAG \"testnet\" }}_testnet{{ end }}"
wrap_in_directory: false
format: zip
files:
- none*
- id: wo/version
- id: archive-versioned
builds:
- arkeod-linux-arm64
- arkeod-darwin-amd64
- arkeod-darwin-arm64
- arkeod-darwin-all
name_template: "{{ .ProjectName }}d_{{ .Os }}_{{ .Arch }}{{ if eq .Env.BUILD_TAG \"testnet\" }}_testnet{{ end }}"
- arkeod-darwin-universal
name_template: >-
{{ .ProjectName }}d_{{ .Version }}_{{ .Os }}_{{ .Arch }}
{{- if eq .Env.BUILD_TAG "testnet" }}_testnet{{ end }}
wrap_in_directory: false
format: zip
files:
- none*
- id: binary

- id: archive-binary
builds:
- arkeod-linux-arm64
- arkeod-darwin-amd64
- arkeod-darwin-arm64
- arkeod-darwin-all
name_template: "{{ .ProjectName }}d_{{ .Os }}_{{ .Arch }}{{ if eq .Env.BUILD_TAG \"testnet\" }}_testnet{{ end }}"
- arkeod-darwin-universal
name_template: >-
{{ .ProjectName }}d_{{ .Os }}_{{ .Arch }}
{{- if eq .Env.BUILD_TAG "testnet" }}_testnet{{ end }}
wrap_in_directory: false
format: binary
files:
- none*

checksum:
name_template: '{{ .ProjectName }}d_v{{ .Version }}{{ if eq .Env.BUILD_TAG "testnet" }}_testnet{{ end }}_cross_checksums.txt'
name_template: >-
{{ .ProjectName }}d_{{ .Version }}
{{- if eq .Env.BUILD_TAG "testnet" }}_testnet{{ end }}
{{- "_cross_checksums.txt" }}
dockers:
- use: buildx
goos: linux
goarch: arm64
dockerfile: docker/Dockerfile
image_templates:
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}:{{if eq .Env.BUILD_TAG "testnet" }}testnet-{{.ShortCommit}}{{else}}{{if eq .Env.RELEASE "true"}}v{{ .Version }}-arm64{{else}}{{ .ShortCommit }}-arm64{{end}}{{end}}'
# Latest tag
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}:latest-arm64'
# Version tag
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}:{{ .Version }}-arm64'
# Testnet tags if applicable
- '{{ if eq .Env.BUILD_TAG "testnet" }}ghcr.io/arkeonetwork/{{ .ProjectName }}:testnet-latest-arm64{{ end }}'
- '{{ if eq .Env.BUILD_TAG "testnet" }}ghcr.io/arkeonetwork/{{ .ProjectName }}:testnet-{{ .Version }}-arm64{{ end }}'
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}d"
- "--label=org.opencontainers.image.description={{.ProjectName}}d"
- "--label=org.opencontainers.image.title=arkeod"
- "--label=org.opencontainers.image.description=Arkeo Daemon"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version=v{{.Version}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.url=https://arkeo.network/"
- "--label=org.opencontainers.image.source=https://github.com/arkeonetwork/arkeo"
- "--label=org.opencontainers.image.licenses=Apache-2.0"

- use: buildx
goos: linux
goarch: arm64
dockerfile: docker/Dockerfile.dev
image_templates:
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:{{if eq .Env.BUILD_TAG "testnet" }}testnet-{{.ShortCommit}}{{else}}{{if eq .Env.RELEASE "true"}}v{{ .Version }}{{else}}{{ .ShortCommit }}{{end}}-arm64{{end}}'
# Latest dev tag
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:latest-arm64'
# Version dev tag
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:{{ .Version }}-arm64'
# Testnet dev tags if applicable
- '{{ if eq .Env.BUILD_TAG "testnet" }}ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:testnet-latest-arm64{{ end }}'
- '{{ if eq .Env.BUILD_TAG "testnet" }}ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:testnet-{{ .Version }}-arm64{{ end }}'
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}d"
- "--label=org.opencontainers.image.description={{.ProjectName}}d"
- "--label=org.opencontainers.image.title=arkeod-dev"
- "--label=org.opencontainers.image.description=Arkeo Daemon Development Build"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version=v{{.Version}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.url=https://arkeo.network/"
- "--label=org.opencontainers.image.source=https://github.com/arkeonetwork/arkeo"
- "--label=org.opencontainers.image.licenses=Apache-2.0"

docker_manifests:
- name_template: 'ghcr.io/arkeonetwork/{{ .ProjectName }}:{{if eq .Env.BUILD_TAG "testnet" }}testnet-{{.ShortCommit}}{{else}}{{if eq .Env.RELEASE "true" }}v{{ .Version }}{{else}}{{ .ShortCommit }}{{end}}{{end}}'
create_flags:
- --insecure
push_flags:
- --insecure
# Production manifests
- name_template: 'ghcr.io/arkeonetwork/{{ .ProjectName }}:latest{{ if eq .Env.BUILD_TAG "testnet" }}-testnet{{ end }}'
image_templates:
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}:{{if eq .Env.RELEASE "true"}}v{{ .Version }}-amd64{{else}}{{ .ShortCommit }}-amd64{{end}}'
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}:{{if eq .Env.RELEASE "true"}}v{{ .Version }}-arm64{{else}}{{ .ShortCommit }}-arm64{{end}}'
- name_template: 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:{{if eq .Env.BUILD_TAG "testnet" }}testnet-{{.ShortCommit}}{{else}}{{if eq .Env.RELEASE "true" }}v{{ .Version }}{{else}}{{ .ShortCommit }}{{end}}{{end}}'
create_flags:
- --insecure
push_flags:
- --insecure
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}:latest-amd64{{ if eq .Env.BUILD_TAG "testnet" }}-testnet{{ end }}'
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}:latest-arm64{{ if eq .Env.BUILD_TAG "testnet" }}-testnet{{ end }}'

- name_template: 'ghcr.io/arkeonetwork/{{ .ProjectName }}:{{ .Version }}{{ if eq .Env.BUILD_TAG "testnet" }}-testnet{{ end }}'
image_templates:
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}:{{ .Version }}-amd64{{ if eq .Env.BUILD_TAG "testnet" }}-testnet{{ end }}'
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}:{{ .Version }}-arm64{{ if eq .Env.BUILD_TAG "testnet" }}-testnet{{ end }}'

# Development manifests
- name_template: 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:latest{{ if eq .Env.BUILD_TAG "testnet" }}-testnet{{ end }}'
image_templates:
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:{{if eq .Env.RELEASE "true"}}v{{ .Version }}-amd64{{else}}{{ .ShortCommit }}-amd64{{end}}'
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:{{if eq .Env.RELEASE "true"}}v{{ .Version }}-arm64{{else}}{{ .ShortCommit }}-arm64{{end}}'
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:latest-amd64{{ if eq .Env.BUILD_TAG "testnet" }}-testnet{{ end }}'
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:latest-arm64{{ if eq .Env.BUILD_TAG "testnet" }}-testnet{{ end }}'

- name_template: 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:{{ .Version }}{{ if eq .Env.BUILD_TAG "testnet" }}-testnet{{ end }}'
image_templates:
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:{{ .Version }}-amd64{{ if eq .Env.BUILD_TAG "testnet" }}-testnet{{ end }}'
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:{{ .Version }}-arm64{{ if eq .Env.BUILD_TAG "testnet" }}-testnet{{ end }}'

release:
skip_upload: '{{ if eq .Env.RELEASE "true" }}false{{else}}true{{end}}'
Loading

0 comments on commit e0f8c52

Please sign in to comment.