Skip to content

Commit

Permalink
fix(scripts): rework script execution using cmd wrapper (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaygridley authored Nov 8, 2024
1 parent fd79969 commit 3ece962
Show file tree
Hide file tree
Showing 22 changed files with 265 additions and 272 deletions.
108 changes: 0 additions & 108 deletions .github/workflows/docker.yaml

This file was deleted.

46 changes: 0 additions & 46 deletions .github/workflows/go-binary-release.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .github/workflows/golangci-lint.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/helm-release.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint

on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
golangci:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0
args: --timeout=5m
139 changes: 139 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: Release Charts

on:
push:
branches:
- main
release:
types: [published]

permissions:
contents: write

env:
HELM_VERSION: 3.14.0

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
helm:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: ${{ env.HELM_VERSION }}

- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_SKIP_EXISTING: true

binary:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5

- name: Run GoReleaser
if: startsWith(github.ref, 'refs/tags/')
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run GoReleaser snapshot
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

image:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4

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

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

- name: Login to Github Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta for latest
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/lablabs/aws-service-quotas-exporter
tags: |
type=raw,value=latest
- name: Build image and push to GitHub Container Registry
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true

- name: Docker meta for tag
if: startsWith(github.ref, 'refs/tags/')
id: meta-tag
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/lablabs/aws-service-quotas-exporter
tags: |
type=raw,value=${{ github.ref_name }}
- name: Build image and push to GitHub Container Registry
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta-tag.outputs.tags }}
labels: ${{ steps.meta-tag.outputs.labels }}
push: true

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
Loading

0 comments on commit 3ece962

Please sign in to comment.