forked from aws-samples/aws-pod-eip-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
249f18b
commit 418b1b5
Showing
2 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
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,34 @@ | ||
--- | ||
name: PR Validation | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-reviewdog: | ||
name: Run ReviewDog | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: ReviewDog - GolangCI Lint | ||
uses: reviewdog/action-golangci-lint@v2 | ||
with: | ||
go_version_file: go.mod | ||
tool_name: GolangCI Lint | ||
golangci_lint_flags: --config=.golangci.yaml --timeout=10m | ||
fail_on_error: true | ||
run-tests: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: go.mod | ||
- name: Tests | ||
run: make test-ci |
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,82 @@ | ||
--- | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
permissions: | ||
contents: write | ||
packages: write | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: release-please | ||
name: Release Please | ||
uses: google-github-actions/release-please-action@v3 | ||
with: | ||
release-type: go | ||
package-name: discord-faucet | ||
changelog-types: >- | ||
[ | ||
{"type":"feat","section":"Features","hidden":false}, | ||
{"type":"fix","section":"Bug Fixes","hidden":false}, | ||
{"type":"chore","section":"Miscellaneous","hidden":true} | ||
] | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
if: steps.release-please.outputs.release_created | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
if: steps.release-please.outputs.release_created | ||
with: | ||
go-version-file: go.mod | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
if: steps.release-please.outputs.release_created | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
if: steps.release-please.outputs.release_created | ||
|
||
- name: Run GoReleaser | ||
if: steps.release-please.outputs.release_created | ||
run: make release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Install Helm | ||
uses: azure/setup-helm@v3 | ||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Push charts to GHCR | ||
run: | | ||
shopt -s nullglob | ||
for pkg in .cr-release-packages/*; do | ||
if [ -z "${pkg:-}" ]; then | ||
break | ||
fi | ||
if ! helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts"; then | ||
echo '::warning:: helm push failed!' | ||
fi | ||
done |