Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
likfees committed Jan 1, 2024
1 parent 6266020 commit 06b50ae
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 69 deletions.
63 changes: 47 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,52 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
- uses: arduino/setup-task@v1
with:
go-version: '>=1.20.2'
cache: true
# More assembly might be required: Docker logins, GPG, etc. It all depends
# on your needs.
- uses: goreleaser/goreleaser-action@v4
version: 3.x
repo-token: ${{ secrets.GH_TOKEN }}
- uses: docker/setup-qemu-action@v2 # v2
- uses: docker/setup-buildx-action@v2 # v2
- name: setup-snapcraft
run: |
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
- uses: actions/setup-go@v1
with:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro'
# distribution:
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
go-version: stable
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3
with:
path: |
./dist/*.deb
./dist/*.rpm
./dist/*.apk
key: ${{ github.ref }}
- uses: sigstore/[email protected]
- uses: anchore/sbom-action/[email protected]
- uses: crazy-max/ghaction-upx@v3
with:
install-only: true
- name: dockerhub-login
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/login-action@v2# v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: goreleaser-release
run: task goreleaser


# - run: git fetch --force --tags
# - uses: actions/setup-go@v3
# with:
# go-version: '>=1.20.2'
# cache: true
# - uses: goreleaser/goreleaser-action@v4
# with:
# distribution: goreleaser
# version: latest
# args: release --clean
# env:
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
105 changes: 52 additions & 53 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,56 +95,55 @@ snapshot:
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

#
#docker_signs:
# - cmd: cosign
# artifacts: manifests
# output: true
# args:
# - "sign"
# - "${artifact}@${digest}"
# - --yes
#
#
#dockers:
# - image_templates:
# - "goreleaser/goreleaser:v{{ .Version }}-amd64"
# - "ghcr.io/goreleaser/goreleaser:v{{ .Version }}-amd64"
# dockerfile: Dockerfile
# use: buildx
# build_flag_templates:
# - "--pull"
# - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/goreleaser/goreleaser/main/README.md"
# - "--label=io.artifacthub.package.logo-url=https://goreleaser.com/static/avatar.png"
# - '--label=io.artifacthub.package.maintainers=[{"name":"Carlos Alexandro Becker","email":"[email protected]"}]'
# - "--label=io.artifacthub.package.license=MIT"
# - "--label=org.opencontainers.image.description=Deliver Go binaries as fast and easily as possible"
# - "--label=org.opencontainers.image.created={{.Date}}"
# - "--label=org.opencontainers.image.name={{.ProjectName}}"
# - "--label=org.opencontainers.image.revision={{.FullCommit}}"
# - "--label=org.opencontainers.image.version={{.Version}}"
# - "--label=org.opencontainers.image.source={{.GitURL}}"
# - "--platform=linux/amd64"
# extra_files:
# - scripts/entrypoint.sh
# - image_templates:
# - "goreleaser/goreleaser:v{{ .Version }}-arm64"
# - "ghcr.io/goreleaser/goreleaser:v{{ .Version }}-arm64"
# dockerfile: Dockerfile
# use: buildx
# build_flag_templates:
# - "--pull"
# - "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/goreleaser/goreleaser/main/README.md"
# - "--label=io.artifacthub.package.logo-url=https://goreleaser.com/static/avatar.png"
# - '--label=io.artifacthub.package.maintainers=[{"name":"Carlos Alexandro Becker","email":"[email protected]"}]'
# - "--label=io.artifacthub.package.license=MIT"
# - "--label=org.opencontainers.image.description=Deliver Go binaries as fast and easily as possible"
# - "--label=org.opencontainers.image.created={{.Date}}"
# - "--label=org.opencontainers.image.name={{.ProjectName}}"
# - "--label=org.opencontainers.image.revision={{.FullCommit}}"
# - "--label=org.opencontainers.image.version={{.Version}}"
# - "--label=org.opencontainers.image.source={{.GitURL}}"
# - "--platform=linux/arm64"
# goarch: arm64
# extra_files:
# - scripts/entrypoint.sh
docker_signs:
- cmd: cosign
artifacts: manifests
output: true
args:
- "sign"
- "${artifact}@${digest}"
- --yes


dockers:
- image_templates:
- "goreleaser/goreleaser:v{{ .Version }}-amd64"
- "ghcr.io/goreleaser/goreleaser:v{{ .Version }}-amd64"
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--pull"
- "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/goreleaser/goreleaser/main/README.md"
- "--label=io.artifacthub.package.logo-url=https://goreleaser.com/static/avatar.png"
- '--label=io.artifacthub.package.maintainers=[{"name":"Carlos Alexandro Becker","email":"[email protected]"}]'
- "--label=io.artifacthub.package.license=MIT"
- "--label=org.opencontainers.image.description=Deliver Go binaries as fast and easily as possible"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/amd64"
extra_files:
- scripts/entrypoint.sh
- image_templates:
- "goreleaser/goreleaser:v{{ .Version }}-arm64"
- "ghcr.io/goreleaser/goreleaser:v{{ .Version }}-arm64"
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--pull"
- "--label=io.artifacthub.package.readme-url=https://raw.githubusercontent.com/goreleaser/goreleaser/main/README.md"
- "--label=io.artifacthub.package.logo-url=https://goreleaser.com/static/avatar.png"
- '--label=io.artifacthub.package.maintainers=[{"name":"Carlos Alexandro Becker","email":"[email protected]"}]'
- "--label=io.artifacthub.package.license=MIT"
- "--label=org.opencontainers.image.description=Deliver Go binaries as fast and easily as possible"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--platform=linux/arm64"
goarch: arm64
extra_files:
- scripts/entrypoint.sh

0 comments on commit 06b50ae

Please sign in to comment.