Skip to content

Commit aa4191c

Browse files
committed
version 3 (ekristen#16)
* initial rewrite of aws-nuke using libnuke * fix: gitignore * fix: add missing workflows * fix: disable push for branches * fix: do not run goreleaser on prs by default * fix: say yes to all cosign prompts * fix: the tags in which goreleaser builds * fix: goreleaser config * version: 3.0.0-beta.1 * fix: Dockerfile BREAKING CHANGE: tool requires a subcommand to run properly
1 parent cd21b0f commit aa4191c

File tree

507 files changed

+27326
-8394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

507 files changed

+27326
-8394
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/release-drafter.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name-template: "v$RESOLVED_VERSION"
2+
tag-template: "$RESOLVED_VERSION"
3+
version-template: "$MAJOR.$MINOR.$PATCH"
4+
version-resolver:
5+
major:
6+
labels:
7+
- "major"
8+
minor:
9+
labels:
10+
- "minor"
11+
- "enhancement"
12+
patch:
13+
labels:
14+
- "auto-update"
15+
- "patch"
16+
- "fix"
17+
- "bugfix"
18+
- "bug"
19+
- "hotfix"
20+
default: "minor"
21+
22+
categories:
23+
- title: "🚀 Enhancements"
24+
labels:
25+
- "enhancement"
26+
- "patch"
27+
- title: "🐛 Bug Fixes"
28+
labels:
29+
- "fix"
30+
- "bugfix"
31+
- "bug"
32+
- "hotfix"
33+
- title: "🤖 Automatic Updates"
34+
labels:
35+
- "auto-update"
36+
37+
exclude-labels:
38+
- "skip-changelog"
39+
40+
change-template: |
41+
<details>
42+
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary>
43+
$BODY
44+
</details>
45+
template: |
46+
$CHANGES
47+
replacers:
48+
# Remove irrelevant information from Renovate bot
49+
- search: '/---\s+^#.*Renovate configuration(?:.|\n)*?This PR has been generated .*/gm'
50+
replace: ""
51+
# Remove Renovate bot banner image
52+
- search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm'
53+
replace: ""

.github/workflows/docs.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: docs
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- docs/**
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
jobs:
24+
deploy:
25+
runs-on: ubuntu-latest
26+
environment:
27+
name: github-pages
28+
url: ${{ steps.deployment.outputs.page_url }}
29+
steps:
30+
- uses: actions/checkout@v3
31+
- name: setup pages
32+
uses: actions/configure-pages@v3
33+
- name: setup python
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: 3.x
37+
- name: setup cache
38+
run: |
39+
echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
40+
- name: handle cache
41+
uses: actions/cache@v3
42+
with:
43+
key: mkdocs-material-${{ env.cache_id }}
44+
path: .cache
45+
restore-keys: |
46+
mkdocs-material-
47+
- name: install mkdocs material
48+
run: |
49+
pip install mkdocs-material
50+
- name: run mkdocs material
51+
run: |
52+
mkdocs build
53+
- name: upload artifact
54+
uses: actions/upload-pages-artifact@v1
55+
with:
56+
# Upload entire repository
57+
path: public/
58+
- name: deploy to GitHub Pages
59+
id: deployment
60+
uses: actions/deploy-pages@v2

.github/workflows/golang.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: release-drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- .github/**
9+
- docs/**
10+
11+
permissions:
12+
contents: write
13+
pull-requests: read
14+
15+
jobs:
16+
publish:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: release-drafter/release-drafter@v5
20+
with:
21+
publish: false
22+
prerelease: true
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.RELEASES_GITHUB_TOKEN }}

.github/workflows/release.yaml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: goreleaser
2+
3+
on:
4+
#pull_request:
5+
# branches:
6+
# - main
7+
push:
8+
branches:
9+
- main
10+
tags:
11+
- "*.*.*"
12+
- "v*.*.*"
13+
- "v*.*.*-*"
14+
15+
permissions:
16+
contents: write
17+
packages: write
18+
19+
jobs:
20+
goreleaser:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
if: github.event_name == 'pull_request'
25+
with:
26+
fetch-depth: 0
27+
ref: ${{ github.event.pull_request.head.ref }}
28+
- uses: actions/checkout@v3
29+
if: github.event_name == 'push'
30+
with:
31+
fetch-depth: 0
32+
- name: setup-go
33+
uses: actions/setup-go@v4
34+
with:
35+
go-version: 1.21.x
36+
- name: setup qemu
37+
id: qemu
38+
uses: docker/setup-qemu-action@v2
39+
- name: setup docker buildx
40+
id: buildx
41+
uses: docker/setup-buildx-action@v2
42+
- name: Login to GitHub Container Registry
43+
uses: docker/login-action@v2
44+
with:
45+
registry: ghcr.io
46+
username: ${{ github.actor }}
47+
password: ${{ secrets.GITHUB_TOKEN }}
48+
- name: install cosign
49+
uses: sigstore/cosign-installer@main
50+
with:
51+
cosign-release: "v2.0.1"
52+
- name: setup cosign
53+
run: |
54+
echo "${COSIGN_KEY}" > "$GITHUB_WORKSPACE/cosign.key"
55+
env:
56+
COSIGN_KEY: ${{ secrets.COSIGN_KEY }}
57+
- name: set goreleaser default args
58+
if: startsWith(github.ref, 'refs/tags/') == true
59+
run: |
60+
echo "GORELEASER_ARGS=" >> $GITHUB_ENV
61+
- name: set goreleaser args for branch
62+
if: startsWith(github.ref, 'refs/tags/') == false
63+
run: |
64+
echo "GORELEASER_ARGS=--snapshot" >> $GITHUB_ENV
65+
- name: set goreleaser args renovate
66+
if: startsWith(github.ref, 'refs/heads/renovate') == true
67+
run: |
68+
echo "GORELEASER_ARGS=--snapshot --skip-publish" >> $GITHUB_ENV
69+
- name: run goreleaser
70+
uses: goreleaser/goreleaser-action@v4
71+
with:
72+
distribution: goreleaser
73+
version: latest
74+
args: release --rm-dist ${{ env.GORELEASER_ARGS }}
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
78+
- name: push docker images (for branches)
79+
if: github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main'
80+
run: |
81+
docker images --format "{{.Repository}}:{{.Tag}}" | grep "ekristen/aws-nuke" | xargs -L1 docker push
82+
- name: upload artifacts
83+
if: github.event.pull_request.base.ref == 'main'
84+
uses: actions/upload-artifact@v3
85+
with:
86+
name: binaries
87+
path: releases/*.tar.gz

.github/workflows/tests.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: tests
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
jobs:
7+
test:
8+
name: test
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: actions/setup-go@v4
13+
with:
14+
go-version: 1.21.x
15+
- name: download go mods
16+
run: |
17+
go mod download
18+
- name: run go tests
19+
run: |
20+
go test -timeout 60s -run ./...

.gitignore

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
/vendor
2-
/aws-nuke
3-
/aws-nuke-*
4-
/dist
5-
/releases
6-
/mocks
1+
releases
72
.envrc
83
.idea
9-
config.yaml
104
cosign.key
11-
*-config.yaml
5+
/config*.yaml
6+
/*-config.yaml
7+
/config.*.yaml
8+

0 commit comments

Comments
 (0)