Skip to content

Commit

Permalink
Tooling rehaul: introduce ARM64 release; use git tags instead of `pro…
Browse files Browse the repository at this point in the history
…duction` branch for releases (#68)

* Use Goreleaser, and publish arm64

Signed-off-by: peterdeme <[email protected]>

* Add setup composite action

Signed-off-by: peterdeme <[email protected]>

---------

Signed-off-by: peterdeme <[email protected]>
  • Loading branch information
peterdeme authored Nov 27, 2023
1 parent 8d8dd75 commit 60c6494
Show file tree
Hide file tree
Showing 15 changed files with 378 additions and 500 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/build-binary.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build & Publish

on: [push]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
publish:
name: 🚀 Build and publish VCS Agent
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
packages: write

steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Publish binary & Docker image
uses: ./.github/workflows/publish
with:
aws_role_to_assume: ${{ startsWith(github.ref, 'refs/tags/v') && secrets.AWS_ROLE_TO_ASSUME || secrets.PREPROD_AWS_ROLE_TO_ASSUME }}
ecr_repository_url: ${{ startsWith(github.ref, 'refs/tags/v') && secrets.PUBLIC_VCS_AGENT_ECR_REPOSITORY_URL || secrets.PREPROD_PUBLIC_VCS_AGENT_ECR_REPOSITORY_URL }}
aws_bucket: ${{ startsWith(github.ref, 'refs/tags/v') && secrets.AWS_S3_BUCKET || secrets.PREPROD_AWS_S3_BUCKET }}
cloudfront_distribution: ${{ startsWith(github.ref, 'refs/tags/v') && secrets.DISTRIBUTION || secrets.PREPROD_DISTRIBUTION }}
bugsnag_api_key: ${{ startsWith(github.ref, 'refs/tags/v') && secrets.BUGSNAG_API_KEY || secrets.PREPROD_BUGSNAG_API_KEY }}
gpg_key_id: ${{ secrets.GPG_KEY_ID }}
gpg_base64_key: ${{ secrets.GPG_KEY_BASE64 }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
github_token: ${{ secrets.GITHUB_TOKEN }}
50 changes: 50 additions & 0 deletions .github/workflows/goreleaser/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Run GoReleaser
description: Sets up the proper Go version, Docker Buildx, QEMU, and runs GoReleaser

inputs:
snapshot:
description: Whether to create a snapshot release or real one
default: "true"
bugsnag_api_key:
description: The Bugsnag API key
default: "NOT_SET"
repository_url:
description: The repository URL that GoReleaser will use to create the Docker images
required: true
github_token:
description: The GitHub token
required: false
disable_github_release:
description: Whether to disable publishing the GitHub release
default: "true"

runs:
using: composite
steps:
- name: Setup Go
uses: actions/setup-go@v4
with: { go-version: "1.20" }

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

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: "linux/amd64,linux/arm64"

- name: Run GoReleaser
id: goreleaser
uses: goreleaser/goreleaser-action@v5
with:
args: release --snapshot=${{ inputs.snapshot }}
env:
BUGSNAG_API_KEY: ${{ inputs.bugsnag_api_key }}
REPOSITORY_URL: ${{ inputs.repository_url }}
GITHUB_TOKEN: ${{ inputs.github_token }}
DISABLE_GITHUB_RELEASE: ${{ inputs.disable_github_release }}

outputs:
metadata:
description: The release metadata of GoReleaser
value: ${{ steps.goreleaser.outputs.metadata }}
6 changes: 5 additions & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: Linting

on: { push: { branches-ignore: [main, production] } }

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
linting:
name: Lint the code
name: 🤓 Lint the code
runs-on: ubuntu-latest
container: golang:1.20

Expand Down
176 changes: 0 additions & 176 deletions .github/workflows/preprod-deployment.yml

This file was deleted.

Loading

0 comments on commit 60c6494

Please sign in to comment.