Skip to content

Commit

Permalink
Merge pull request #273 from arkeonetwork/fix-update-worklfow-for-rel…
Browse files Browse the repository at this point in the history
…ease

fix: update actions release
  • Loading branch information
shreyasbhat0 authored Aug 26, 2024
2 parents 545be91 + df82dc4 commit 6527713
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 26 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ on:

jobs:
release:
name: release
name: ${{ matrix.release }}
runs-on: ubuntu-latest
strategy:
matrix:
release: ["release", "release-cross","release-testnet","release-testnet-cross"]
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -24,16 +27,9 @@ jobs:

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

- name: release-cross
env:
RELEASE: true
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: make release-cross


- name: release
- name: ${{ matrix.release }}
env:
RELEASE: true
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: make release
run: make ${{ matrix.release }}
24 changes: 14 additions & 10 deletions .goreleaser-cross.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,19 @@ universal_binaries:
- arkeod-darwin-amd64
- arkeod-darwin-arm64
replace: false
name_template: "{{ .ProjectName }}d"
name_template: "{{ .ProjectName }}d{{ if eq .Env.BUILD_TAG \"testnet\" }}-testnet{{ end }}"

release:
skip_upload: '{{ if eq .Env.RELEASE "true" }}false{{else}}true{{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 }}"
name_template: "{{ .ProjectName }}d_v{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if eq .Env.BUILD_TAG \"testnet\" }}-testnet{{ end }}"
wrap_in_directory: false
format: zip
files:
Expand All @@ -114,7 +116,7 @@ archives:
- arkeod-darwin-amd64
- arkeod-darwin-arm64
- arkeod-darwin-all
name_template: "{{ .ProjectName }}d_{{ .Os }}_{{ .Arch }}"
name_template: "{{ .ProjectName }}d_{{ .Os }}_{{ .Arch }}{{ if eq .Env.BUILD_TAG \"testnet\" }}-testnet{{ end }}"
wrap_in_directory: false
format: zip
files:
Expand All @@ -125,11 +127,12 @@ archives:
- arkeod-darwin-amd64
- arkeod-darwin-arm64
- arkeod-darwin-all
name_template: "{{ .ProjectName }}d_{{ .Os }}_{{ .Arch }}"
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 }}_cross_checksums.txt"

Expand All @@ -138,7 +141,7 @@ dockers:
goos: linux
goarch: arm64
image_templates:
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}:{{if eq .Env.RELEASE "true"}}v{{ .Version }}-arm64{{else}}{{ .ShortCommit }}-arm64{{end}}'
- '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}}'
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
Expand All @@ -155,7 +158,7 @@ dockers:
goarch: arm64
dockerfile: Dockerfile.dev
image_templates:
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:{{if eq .Env.RELEASE "true"}}v{{ .Version }}{{else}}{{ .ShortCommit }}{{end}}-arm64'
- '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}}'
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
Expand All @@ -167,20 +170,21 @@ dockers:
- "--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.RELEASE "true" }}v{{ .Version }}{{else}}{{ .ShortCommit }}{{end}}'
- 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
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.RELEASE "true" }}v{{ .Version }}{{else}}{{ .ShortCommit }}{{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
image_templates:
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:{{if eq .Env.RELEASE "true"}}v{{ .Version }}{{else}}{{ .ShortCommit }}{{end}}-amd64'
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:{{if eq .Env.RELEASE "true"}}v{{ .Version }}{{else}}{{ .ShortCommit }}{{end}}-arm64'
- '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}}'
14 changes: 8 additions & 6 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@ archives:
- id: w/version
builds:
- arkeod-linux-amd64
name_template: '{{ .ProjectName }}d_v{{ .Version }}_{{ .Os }}_{{ .Arch }}'
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
builds:
- arkeod-linux-amd64
name_template: '{{ .ProjectName }}d_{{ .Os }}_{{ .Arch }}'
name_template: '{{ .ProjectName }}d_{{ .Os }}_{{ .Arch }}{{ if eq .Env.BUILD_TAG "testnet" }}-testnet{{ end }}'
wrap_in_directory: false
format: zip
files:
- none*
- id: binary
builds:
- arkeod-linux-amd64
name_template: '{{ .ProjectName }}d_{{ .Os }}_{{ .Arch }}'
name_template: '{{ .ProjectName }}d_{{ .Os }}_{{ .Arch }}{{ if eq .Env.BUILD_TAG "testnet" }}-testnet{{ end }}'
wrap_in_directory: false
format: binary
files:
Expand All @@ -65,7 +65,7 @@ dockers:
goos: linux
goarch: amd64
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.BUILD_TAG "testnet" }}testnet-{{.ShortCommit}}{{ else }}{{ if eq .Env.RELEASE "true" }}v{{ .Version }}-amd64{{ else }}{{ .ShortCommit }}-amd64{{ end }}{{ end }}'
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
Expand All @@ -77,12 +77,14 @@ dockers:
- "--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"
- "{{ if eq .Env.BUILD_TAG \"testnet\" }}--label=org.opencontainers.image.tag=testnet{{ end }}"

- use: buildx
goos: linux
goarch: amd64
dockerfile: Dockerfile.dev
image_templates:
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:{{if eq .Env.RELEASE "true"}}v{{ .Version }}{{else}}{{ .ShortCommit }}{{end}}-amd64'
- 'ghcr.io/arkeonetwork/{{ .ProjectName }}-dev:{{ if eq .Env.BUILD_TAG "testnet" }}testnet-{{.ShortCommit}}{{ else }}{{ if eq .Env.RELEASE "true" }}v{{ .Version }}{{ else }}{{ .ShortCommit }}{{ end }}-amd64{{ end }}'
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
Expand All @@ -93,4 +95,4 @@ dockers:
- "--label=org.opencontainers.image.version=v{{.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"
- "--label=org.opencontainers.image.licenses=Apache-2.0"
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -365,4 +365,37 @@ release-cross:
-f .goreleaser-cross.yaml \
--clean \
--skip-validate=$(GORELEASER_SKIP_VALIDATE) \
--skip-publish=$(GORELEASER_SKIP_PUBLISH)

release-testnet:
$(DOCKER) run \
--rm \
-e CGO_ENABLED=1 \
-e BUILD_TAG="testnet" \
-e RELEASE=$(RELEASE)\
-e GITHUB_TOKEN="$(GITHUB_TOKEN)" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-v `pwd`/sysroot:/sysroot \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/goreleaser/goreleaser:${GORELEASER_VERSION} \
--clean \
--skip-validate=$(GORELEASER_SKIP_VALIDATE) \
--skip-publish=$(GORELEASER_SKIP_PUBLISH)

release-testnet-cross:
$(DOCKER) run \
--rm \
-e CGO_ENABLED=1 \
-e BUILD_TAG="testnet" \
-e RELEASE=$(RELEASE)\
-e GITHUB_TOKEN="$(GITHUB_TOKEN)" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-v `pwd`/sysroot:/sysroot \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
-f .goreleaser-cross.yaml \
--clean \
--skip-validate=$(GORELEASER_SKIP_VALIDATE) \
--skip-publish=$(GORELEASER_SKIP_PUBLISH)

0 comments on commit 6527713

Please sign in to comment.