diff --git a/.github/auto-release.yml b/.github/auto-release.yml deleted file mode 100644 index b45efb7..0000000 --- a/.github/auto-release.yml +++ /dev/null @@ -1,54 +0,0 @@ -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' - - 'no-release' - default: 'minor' - -categories: -- title: '🚀 Enhancements' - labels: - - 'enhancement' - - 'patch' -- title: '🐛 Bug Fixes' - labels: - - 'fix' - - 'bugfix' - - 'bug' - - 'hotfix' -- title: '🤖 Automatic Updates' - labels: - - 'auto-update' - -change-template: | -
- $TITLE @$AUTHOR (#$NUMBER) - - $BODY -
- -template: | - $CHANGES - -replacers: -# Remove irrelevant information from Renovate bot -- search: '/(?<=---\s)\s*^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm' - replace: '' -# Remove Renovate bot banner image -- search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm' - replace: '' diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml deleted file mode 100644 index 0929676..0000000 --- a/.github/workflows/auto-release.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: auto-release - -on: - push: - branches: - - main - - master - - production - -jobs: - auto: - uses: cloudposse/.github/.github/workflows/shared-auto-release.yml@main - with: - publish: true - secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5404104..178c027 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,75 +1,15 @@ -# This GitHub action publish assets for release when a tag is created. -name: release +name: Release on: - push: - tags: - - "*" + release: + types: [published] - workflow_dispatch: +permissions: {} -jobs: - goreleaser: - runs-on: "self-hosted-large" - steps: - - name: Install Git & GPG - run: |- - sudo apt-get update && sudo apt-get install -y git gnupg2 - - - name: Checkout - uses: actions/checkout@v3 - - - name: Unshallow - run: |- - git fetch --prune --unshallow - - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: "1.20" - - - name: Import GPG key - id: import_gpg - uses: crazy-max/ghaction-import-gpg@v5 - with: - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false - - name: Check disk space before - shell: bash - run: |- - printf "\nPWD is %s\ndf -h %s\n\n" "$(pwd -P)" "$(pwd -P)" - df -h $(pwd -P) - if [[ -n $TMPDIR ]]; then - printf "\n\nTMPDIR set to %s\ndf -h %s\n\n" "$TMPDIR" "$TMPDIR" - df -h "$TMPDIR" - else - printf "\n\nTMPDIR not set, showing space in /tmp\n\n" - df -h /tmp - fi - printf "\n\nAll disk space:\n" - df -h - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 - with: - version: latest - args: release --clean --parallelism 2 --timeout 180m - env: - GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check disk space after - if: success() || failure() - shell: bash - run: |- - printf "\nPWD is %s\ndf -h %s\n\n" "$(pwd -P)" "$(pwd -P)" - df -h $(pwd -P) - if [[ -n $TMPDIR ]]; then - printf "\n\nTMPDIR set to %s\ndf -h %s\n\n" "$TMPDIR" "$TMPDIR" - df -h "$TMPDIR" - else - printf "\n\nTMPDIR not set, showing space in /tmp\n\n" - df -h /tmp - fi - printf "\n\nAll disk space:\n" - df -h +jobs: + perform: + uses: cloudposse/.github/.github/workflows/shared-release-branches.yml@main + secrets: inherit diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 30235a6..b6cf73f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,10 +4,21 @@ on: types: [opened, synchronize, reopened] paths-ignore: - "README.md" - release: - types: [created] + + push: + branches: + - main + - release/v* paths-ignore: - - "README.md" + - '.github/**' + - 'docs/**' + - 'examples/**' + - 'test/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + jobs: # ensure the code builds... build: @@ -15,15 +26,15 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - name: Set up Go - uses: actions/setup-go@v2.1.3 + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + + - name: 'Setup Go' + uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version-file: go.mod id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v2.3.3 - - name: Get dependencies run: | go mod download @@ -53,15 +64,15 @@ jobs: - "1.4.0" - "1.5.0" steps: - - name: Set up Go - uses: actions/setup-go@v2.1.3 + - name: Check out code into the Go module directory + uses: actions/checkout@v4 + + - name: 'Setup Go' + uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version-file: go.mod id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v2.3.3 - - name: Get dependencies run: | make deps @@ -73,3 +84,11 @@ jobs: TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }} run: | make testacc + + release: + needs: test + if: github.event_name == 'push' + uses: cloudposse/.github/.github/workflows/shared-go-auto-release.yml@main + with: + publish: true + secrets: inherit diff --git a/.github/workflows/validate-codeowners.yml b/.github/workflows/validate-codeowners.yml index 70f829e..cc1e159 100644 --- a/.github/workflows/validate-codeowners.yml +++ b/.github/workflows/validate-codeowners.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: "Checkout source code at current commit" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: mszostok/codeowners-validator@v0.7.1 if: github.event.pull_request.head.repo.full_name == github.repository name: "Full check of CODEOWNERS" diff --git a/.goreleaser.yml b/.goreleaser.yml deleted file mode 100644 index a4c50f8..0000000 --- a/.goreleaser.yml +++ /dev/null @@ -1,47 +0,0 @@ -# Visit https://goreleaser.com for documentation on how to customize this -# behavior. -before: - hooks: - # this is just an example and not a requirement for provider building/publishing - - go mod tidy -builds: - - env: - # goreleaser does not work with CGO, it could also complicate - # usage by users in CI/CD systems like Terraform Cloud where - # they are unable to install libraries. - - CGO_ENABLED=0 - mod_timestamp: "{{ .CommitTimestamp }}" - flags: - - -trimpath - ldflags: - - "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}" - goos: - - linux - - darwin - - windows - goarch: - - amd64 - - arm64 - binary: "{{ .ProjectName }}_v{{ .Version }}" -archives: - - format: zip - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" -checksum: - name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS" - algorithm: sha256 -signs: - - artifacts: checksum - args: - # since we are using this in a GitHub action we need to pass the batch flag to indicate its not interactive. - - "--batch" - - "--local-user" - - "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key - - "--output" - - "${signature}" - - "--detach-sign" - - "${artifact}" -release: - # If you want to manually examine the release before its live, uncomment this line: - # draft: true -changelog: - skip: true