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/settings.yml b/.github/settings.yml new file mode 100644 index 0000000..16d0eea --- /dev/null +++ b/.github/settings.yml @@ -0,0 +1,13 @@ +# These settings are synced to GitHub by https://probot.github.io/apps/settings/ +_extends: .github + +repository: + # A URL with more information about the repository + homepage: https://cloudposse.com + + # Either `true` to enable projects for this repository, or `false` to disable them. + # If projects are disabled for the organization, passing `true` will cause an API error. + has_projects: false + + # Either `true` to enable the wiki for this repository, `false` to disable it. + has_wiki: false diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml deleted file mode 100644 index 3a38fae..0000000 --- a/.github/workflows/auto-release.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: auto-release - -on: - push: - branches: - - main - - master - - production - -jobs: - publish: - runs-on: ubuntu-latest - steps: - # Get PR from merged commit to master - - uses: actions-ecosystem/action-get-merged-pull-request@v1 - id: get-merged-pull-request - with: - github_token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} - # Drafts your next Release notes as Pull Requests are merged into "main" - - uses: release-drafter/release-drafter@v5 - with: - publish: ${{ !contains(steps.get-merged-pull-request.outputs.labels, 'no-release') }} - prerelease: false - config-name: auto-release.yml - env: - GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} diff --git a/.github/workflows/docker-promote.yml b/.github/workflows/docker-promote.yml new file mode 100644 index 0000000..c053ce1 --- /dev/null +++ b/.github/workflows/docker-promote.yml @@ -0,0 +1,35 @@ +name: Docker Promote + +on: + push: + tags: + - "*" + +permissions: + contents: read + packages: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + ci-docker: + runs-on: ubuntu-latest + steps: + - name: Set output + id: vars + run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT + + - uses: cloudposse/github-action-docker-promote@0.3.0 + id: promote + with: + registry: ghcr.io + organization: "${{ github.event.repository.owner.login }}" + repository: "${{ github.event.repository.name }}" + login: "${{ github.actor }}" + password: "${{ secrets.GITHUB_TOKEN }}" + platforms: linux/amd64,linux/arm64 + from: sha-${{ github.sha }} + to: ${{ steps.vars.outputs.tag }} + use_metadata: false diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index 4482f84..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "docker" -on: - push: - branches: - - master - pull_request: - types: [opened, synchronize, reopened] - release: - types: - - created -jobs: - build-and-push: - runs-on: ubuntu-latest - steps: - - name: "Checkout source code at current commit" - uses: actions/checkout@v2 - - name: "Build and push docker image to DockerHub" - uses: docker/build-push-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - repository: ${{ github.repository }} - registry: registry-1.docker.io - tag_with_ref: true - tag_with_sha: true diff --git a/.github/workflows/feature-branch.yml b/.github/workflows/feature-branch.yml index f94fa98..6ebbbc6 100644 --- a/.github/workflows/feature-branch.yml +++ b/.github/workflows/feature-branch.yml @@ -9,30 +9,74 @@ on: - synchronize - reopened + push: + branches: + - main + - release/v* + paths-ignore: + - '.github/**' + - 'docs/**' + - 'examples/**' + - 'test/**' + +permissions: + contents: read + packages: write + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + jobs: - build: + ci-go: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: '1.20' + go-version-file: go.mod - name: Test Snapshot Release - uses: goreleaser/goreleaser-action@v4 + uses: goreleaser/goreleaser-action@v5 with: distribution: goreleaser version: latest - args: release --clean --snapshot + args: release --config ./dev.goreleaser.yaml --clean --snapshot - name: Upload Test Release Assets - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: github-status-updater path: dist/* retention-days: 3 + + ci-docker: + runs-on: ubuntu-latest + steps: + - name: "Checkout source code at current commit" + uses: actions/checkout@v4 + + - name: Build + id: build + uses: cloudposse/github-action-docker-build-push@1.15.1 + with: + registry: ghcr.io + organization: "${{ github.event.repository.owner.login }}" + repository: "${{ github.event.repository.name }}" + login: "${{ github.actor }}" + password: "${{ secrets.GITHUB_TOKEN }}" + platforms: linux/amd64,linux/arm64 + + release: + if: github.event_name == 'push' + needs: [ci-go, ci-docker] + uses: cloudposse/.github/.github/workflows/shared-go-auto-release.yml@main + with: + publish: true + format: binary + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e1a769..178c027 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,34 +1,15 @@ name: Release - on: - workflow_dispatch: - release: - types: - - published + types: [published] -permissions: - contents: write +permissions: {} -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: '1.20' - - - name: Public Release - uses: goreleaser/goreleaser-action@v4 - with: - distribution: goreleaser - version: latest - args: release --clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +jobs: + perform: + uses: cloudposse/.github/.github/workflows/shared-release-branches.yml@main + 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.yaml b/dev.goreleaser.yaml similarity index 100% rename from .goreleaser.yaml rename to dev.goreleaser.yaml diff --git a/go.mod b/go.mod index 860371e..144ae05 100644 --- a/go.mod +++ b/go.mod @@ -6,5 +6,5 @@ require github.com/google/go-github/v42 v42.0.0 require ( github.com/google/go-querystring v1.1.0 // indirect - golang.org/x/crypto v0.8.0 // indirect + golang.org/x/crypto v0.17.0 // indirect ) diff --git a/go.sum b/go.sum index 04720c4..5ec9edb 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,6 @@ github.com/google/go-github/v42 v42.0.0 h1:YNT0FwjPrEysRkLIiKuEfSvBPCGKphW5aS5Px github.com/google/go-github/v42 v42.0.0/go.mod h1:jgg/jvyI0YlDOM1/ps6XYh04HNQ3vKf0CVko62/EhRg= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ= -golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=