Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooling rehaul: introduce ARM64 release; use git tags instead of production branch for releases #68

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
peterdeme marked this conversation as resolved.
Show resolved Hide resolved
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
Loading