-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
451 additions
and
142 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,5 @@ go.work | |
.idea | ||
|
||
coverage.out | ||
|
||
bin/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |
Oops, something went wrong.