Skip to content

Commit

Permalink
fix: set goreleaser inside release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
acouvreur committed Oct 22, 2024
1 parent 8f48e6e commit 48582be
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 11 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Main
name: "Build"

on:
push:
branches:
- master
pull_request:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dockerhub-description.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update Docker Hub Description
name: "Update Docker Hub Description"
on:
push:
tags:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: "Release binaries and images"
name: "goreleaser"
on:
push:
tags:
- v*

permissions:
id-token: write # For cosign
packages: write # For GHCR
contents: write # Releases
id-token: write # For cosign
packages: write # For GHCR
contents: write # Releases

jobs:
release:
Expand Down
40 changes: 38 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create tag and release
name: "Release"
on:
push:
branches:
Expand All @@ -8,6 +8,8 @@ permissions:
pull-requests: write # to be able to comment on released pull requests
issues: write # to be able to comment on released issues
contents: write # to be able to publish a GitHub release
id-token: write # For cosign
packages: write # For GHCR

jobs:
release:
Expand All @@ -24,7 +26,41 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20'


# https://github.com/marketplace/actions/setup-go-environment
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: stable

- name: dockerhub-login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: ghcr-login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

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

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

- name: Install Cosign
uses: sigstore/[email protected]

# https://goreleaser.com/ci/actions/
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
install-only: true

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 3 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ module.exports = {
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github",
["@semantic-release/exec", {
"publishCmd": "echo \"${nextRelease.notes}\" > /tmp/release-notes.md; goreleaser release --release-notes /tmp/release-notes.md --clean"
}]
]
}

0 comments on commit 48582be

Please sign in to comment.