Skip to content

Commit

Permalink
ci jobs to build everything
Browse files Browse the repository at this point in the history
  • Loading branch information
jlehtimaki committed Jun 20, 2024
1 parent 418b1b5 commit 089b274
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 65 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/pr-validation.yaml

This file was deleted.

58 changes: 27 additions & 31 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
push:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
release:
Expand All @@ -15,44 +18,37 @@ jobs:
id-token: write
runs-on: ubuntu-latest
steps:
- id: release-please
name: Release Please
uses: google-github-actions/release-please-action@v3
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
release-type: go
package-name: discord-faucet
changelog-types: >-
[
{"type":"feat","section":"Features","hidden":false},
{"type":"fix","section":"Bug Fixes","hidden":false},
{"type":"chore","section":"Miscellaneous","hidden":true}
]
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout
uses: actions/checkout@v3
if: steps.release-please.outputs.release_created
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
fetch-depth: 0
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Set up Go
uses: actions/setup-go@v4
if: steps.release-please.outputs.release_created
- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
go-version-file: go.mod

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: steps.release-please.outputs.release_created
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
if: steps.release-please.outputs.release_created
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

- name: Run GoReleaser
if: steps.release-please.outputs.release_created
run: make release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
Expand Down

0 comments on commit 089b274

Please sign in to comment.