Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
ci: fix release workflow (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendan authored May 3, 2023
1 parent f901f84 commit f01a794
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 53 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
name: Release
on: # yamllint disable-line rule:truthy
on: # yamllint disable-line rule:truthy
push:
branches-ignore:
- '**'
- "**"
tags:
- 'v*.*.*'
- "v*.*.*"
# to be used by fork patch-releases ^^
- 'v*.*.*-*'
- "v*.*.*-*"

jobs:
goreleaser:
Expand Down Expand Up @@ -38,20 +38,16 @@ jobs:
--privileged \
-e CGO_ENABLED=1 \
-e GITHUB_TOKEN \
-e DOCKER_USERNAME \
-e DOCKER_PASSWORD \
-e SLACK_WEBHOOK \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
--rm-dist --skip-validate
env:
PACKAGE_NAME: github.com/0xPolygon/polygon-edge
PACKAGE_NAME: github.com/topos-network/polygon-edge
GOLANG_CROSS_VERSION: v1.18.3
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.prepare.outputs.tag_name }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
49 changes: 5 additions & 44 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ builds:
env:
- CC=o64-clang
- CXX=o64-clang++
ldflags:
-s -w -X 'github.com/0xPolygon/polygon-edge/versioning.Version=v{{ .Version }}'
ldflags: -s -w -X 'github.com/topos-network/polygon-edge/versioning.Version=v{{ .Version }}'

- id: darwin-arm64
main: ./main.go
Expand All @@ -29,8 +28,7 @@ builds:
env:
- CC=oa64-clang
- CXX=oa64-clang++
ldflags:
-s -w -X 'github.com/0xPolygon/polygon-edge/versioning.Version=v{{ .Version }}'
ldflags: -s -w -X 'github.com/topos-network/polygon-edge/versioning.Version=v{{ .Version }}'

- id: linux-amd64
main: ./main.go
Expand All @@ -44,7 +42,7 @@ builds:
- CXX=g++
ldflags:
# We need to build a static binary because we are building in a glibc based system and running in a musl container
-s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Version=v{{ .Version }}'
-s -w -linkmode external -extldflags "-static" -X 'github.com/topos-network/polygon-edge/versioning.Version=v{{ .Version }}'
tags:
- netgo
- osusergo
Expand All @@ -61,14 +59,13 @@ builds:
- CXX=aarch64-linux-gnu-g++
ldflags:
# We need to build a static binary because we are building in a glibc based system and running in a musl container
-s -w -linkmode external -extldflags "-static" -X 'github.com/0xPolygon/polygon-edge/versioning.Version=v{{ .Version }}'
-s -w -linkmode external -extldflags "-static" -X 'github.com/topos-network/polygon-edge/versioning.Version=v{{ .Version }}'
tags:
- netgo
- osusergo

archives:
-
files:
- files:
- LICENSE
- README.md

Expand Down Expand Up @@ -96,39 +93,3 @@ archives:

snapshot:
name_template: "{{ .Tag }}.next"

dockers:
- image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-amd64
dockerfile: Dockerfile.release
use: buildx
goarch: amd64
ids:
- linux-amd64
build_flag_templates:
- --platform=linux/amd64
skip_push: false

- image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-arm64
dockerfile: Dockerfile.release
use: buildx
goarch: arm64
ids:
- linux-arm64
build_flag_templates:
- --platform=linux/arm64
skip_push: false

docker_manifests:
- name_template: 0xpolygon/{{ .ProjectName }}:{{ .Version }}
image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-amd64
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-arm64
skip_push: false

- name_template: 0xpolygon/{{ .ProjectName }}:latest
image_templates:
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-amd64
- 0xpolygon/{{ .ProjectName }}:{{ .Version }}-arm64
skip_push: auto

0 comments on commit f01a794

Please sign in to comment.