Skip to content

Commit

Permalink
Use Goreleaser, and publish arm64
Browse files Browse the repository at this point in the history
Signed-off-by: peterdeme <[email protected]>
  • Loading branch information
peterdeme committed Nov 26, 2023
1 parent 8d8dd75 commit 0d621bf
Show file tree
Hide file tree
Showing 15 changed files with 364 additions and 491 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/build-binary.yml

This file was deleted.

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

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

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

jobs:
build-binary:
name: 👷 Build binary
runs-on: ubuntu-latest
container: golang:1.20

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

- name: Mark source directory as safe.
run: git config --global --add safe.directory $GITHUB_WORKSPACE

- 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
uses: goreleaser/goreleaser-action@v5
with:
args: release --snapshot
env:
BUGSNAG_API_KEY: "REAL_KEY_NOT_NEEDED_HERE"
REPOSITORY_URL: "ghcr.io/spacelift-io/vcs-agent"
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: 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 }}
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 0d621bf

Please sign in to comment.