Skip to content

Commit

Permalink
version 3 (ekristen#16)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ekristen authored and corybekk committed Nov 5, 2024
1 parent f154c45 commit c94c66d
Show file tree
Hide file tree
Showing 494 changed files with 26,994 additions and 6,580 deletions.
53 changes: 53 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name-template: "v$RESOLVED_VERSION"
tag-template: "$RESOLVED_VERSION"
version-template: "$MAJOR.$MINOR.$PATCH"
version-resolver:
major:
labels:
- "major"
minor:
labels:
- "minor"
- "enhancement"
patch:
labels:
- "auto-update"
- "patch"
- "fix"
- "bugfix"
- "bug"
- "hotfix"
default: "minor"

categories:
- title: "🚀 Enhancements"
labels:
- "enhancement"
- "patch"
- title: "🐛 Bug Fixes"
labels:
- "fix"
- "bugfix"
- "bug"
- "hotfix"
- title: "🤖 Automatic Updates"
labels:
- "auto-update"

exclude-labels:
- "skip-changelog"

change-template: |
<details>
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary>
$BODY
</details>
template: |
$CHANGES
replacers:
# Remove irrelevant information from Renovate bot
- search: '/---\s+^#.*Renovate configuration(?:.|\n)*?This PR has been generated .*/gm'
replace: ""
# Remove Renovate bot banner image
- search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm'
replace: ""
60 changes: 60 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: docs

on:
workflow_dispatch:
push:
branches:
- main
paths:
- docs/**

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
- name: setup pages
uses: actions/configure-pages@v3
- name: setup python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: setup cache
run: |
echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- name: handle cache
uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: install mkdocs material
run: |
pip install mkdocs-material
- name: run mkdocs material
run: |
mkdocs build
- name: upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: public/
- name: deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
32 changes: 0 additions & 32 deletions .github/workflows/golang.yaml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/release-drafter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: release-drafter

on:
push:
branches:
- main
paths-ignore:
- .github/**
- docs/**

permissions:
contents: write
pull-requests: read

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
with:
publish: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.RELEASES_GITHUB_TOKEN }}
87 changes: 87 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: goreleaser

on:
#pull_request:
# branches:
# - main
push:
branches:
- main
tags:
- "*.*.*"
- "v*.*.*"
- "v*.*.*-*"

permissions:
contents: write
packages: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- uses: actions/checkout@v3
if: github.event_name == 'push'
with:
fetch-depth: 0
- name: setup-go
uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: setup qemu
id: qemu
uses: docker/setup-qemu-action@v2
- name: setup docker buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: install cosign
uses: sigstore/cosign-installer@main
with:
cosign-release: "v2.0.1"
- name: setup cosign
run: |
echo "${COSIGN_KEY}" > "$GITHUB_WORKSPACE/cosign.key"
env:
COSIGN_KEY: ${{ secrets.COSIGN_KEY }}
- name: set goreleaser default args
if: startsWith(github.ref, 'refs/tags/') == true
run: |
echo "GORELEASER_ARGS=" >> $GITHUB_ENV
- name: set goreleaser args for branch
if: startsWith(github.ref, 'refs/tags/') == false
run: |
echo "GORELEASER_ARGS=--snapshot" >> $GITHUB_ENV
- name: set goreleaser args renovate
if: startsWith(github.ref, 'refs/heads/renovate') == true
run: |
echo "GORELEASER_ARGS=--snapshot --skip-publish" >> $GITHUB_ENV
- name: run goreleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --rm-dist ${{ env.GORELEASER_ARGS }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
- name: push docker images (for branches)
if: github.ref == 'refs/heads/main' || github.event.pull_request.base.ref == 'main'
run: |
docker images --format "{{.Repository}}:{{.Tag}}" | grep "ekristen/aws-nuke" | xargs -L1 docker push
- name: upload artifacts
if: github.event.pull_request.base.ref == 'main'
uses: actions/upload-artifact@v3
with:
name: binaries
path: releases/*.tar.gz
20 changes: 20 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: tests
on:
pull_request:
branches:
- main
jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.21.x
- name: download go mods
run: |
go mod download
- name: run go tests
run: |
go test -timeout 60s -run ./...
13 changes: 5 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
/vendor
/aws-nuke
/aws-nuke-*
/dist
/releases
/mocks
releases
.envrc
.idea
config.yaml
cosign.key
*-config.yaml
/config*.yaml
/*-config.yaml
/config.*.yaml

11 changes: 7 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ dockers:
- use: buildx
goos: linux
goarch: amd64
dockerfile: Dockerfile.goreleaser
dockerfile: Dockerfile
image_templates:
- ghcr.io/ekristen/aws-nuke:v{{ .Version }}-amd64
build_flag_templates:
- "--target=goreleaser"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
Expand All @@ -58,10 +59,11 @@ dockers:
- use: buildx
goos: linux
goarch: arm64
dockerfile: Dockerfile.goreleaser
dockerfile: Dockerfile
image_templates:
- ghcr.io/ekristen/aws-nuke:v{{ .Version }}-arm64
build_flag_templates:
- "--target=goreleaser"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
Expand All @@ -73,10 +75,11 @@ dockers:
goos: linux
goarch: arm
goarm: "7"
dockerfile: Dockerfile.goreleaser
dockerfile: Dockerfile
image_templates:
- ghcr.io/ekristen/aws-nuke:v{{ .Version }}-arm32v7
build_flag_templates:
- "--target=goreleaser"
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title={{.ProjectName}}"
Expand All @@ -95,7 +98,7 @@ signs:
- cmd: cosign
stdin: "{{ .Env.COSIGN_PASSWORD }}"
args:
["sign-blob", "--key=cosign.key", "--output=${signature}", "${artifact}"]
["sign-blob", "--yes", "--key=cosign.key", "--output=${signature}", "${artifact}"]
artifacts: all
docker_signs:
- artifacts: all
Expand Down
9 changes: 0 additions & 9 deletions Dockerfile.goreleaser

This file was deleted.

22 changes: 17 additions & 5 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
The MIT License (MIT)

Copyright 2021 Erik Kristensen
Copyright 2016-2021 reBuy reCommerce GmbH
Copyright (c) 2016 reBuy reCommerce GmbH
Copyright (c) 2021 Erik Kristensen

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit c94c66d

Please sign in to comment.