Skip to content

Commit

Permalink
license file
Browse files Browse the repository at this point in the history
  • Loading branch information
rafajpet committed Mar 25, 2024
2 parents e188ba5 + 87f6030 commit 3269670
Show file tree
Hide file tree
Showing 17 changed files with 451 additions and 142 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/docker-master.yaml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/docker-release.yaml

This file was deleted.

108 changes: 108 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Build and publish Docker images

on:
push:
branches:
- main
tags:
- 'v*'
release:
types: [published]


jobs:
latest:
runs-on: ubuntu-22.04
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
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
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/lablabs/aws-service-quotas-exporter
tags: |
type=raw,value=latest
- 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
# generate Docker tags based on the following events/attributes
tags: |
type=raw,value=${{ github.ref_name }}
- name: Build image and push to GitHub Container Registry
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: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
tag:
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/')
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
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
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: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
52 changes: 36 additions & 16 deletions .github/workflows/go-binary-release.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,46 @@
name: Generate release binary artifacts

on:
push:
branches:
- main
tags:
- 'v*'
release:
types:
- created
types: [published]

permissions:
contents: write

jobs:
generate:
name: Generate cross-platform builds
runs-on: ubuntu-22.04
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
-
name: Checkout
uses: actions/checkout@v4
- name: Generate build files
uses: thatisuday/go-cross-build@v1
with:
platforms: 'linux/amd64, darwin/amd64, linux/arm64'
package: ''
name: 'aws-service-quotas-exporter'
compress: 'false'
dest: 'dist'
- name: Copy build-artifacts
uses: skx/github-action-publish-binaries@master
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:
args: "./dist/*"
distribution: goreleaser
version: latest
args: release --clean --snapshot
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ go.work
.idea

coverage.out

bin/*
12 changes: 12 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
builds:
- id: "exporter"
main: ./cmd/exporter
binary: exporter
env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
mod_timestamp: "{{ .CommitTimestamp }}"
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ helm 3.14.2
awscli 2.7.14
pre-commit 2.20.0
task 3.35.1
golang 1.22.0
Loading

0 comments on commit 3269670

Please sign in to comment.