diff --git a/.github/draft-release.yml b/.github/draft-release.yml deleted file mode 100644 index b45efb7..0000000 --- a/.github/draft-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/docker-promote.yml b/.github/workflows/docker-promote.yml new file mode 100644 index 0000000..da2d7d2 --- /dev/null +++ b/.github/workflows/docker-promote.yml @@ -0,0 +1,31 @@ +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: + - 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: ${{ github.event.release.tag_name }} + use_metadata: false \ No newline at end of file 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/draft-release.yml b/.github/workflows/draft-release.yml deleted file mode 100644 index c3473a1..0000000 --- a/.github/workflows/draft-release.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: auto-release - -on: - push: - branches: - - master - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: cloudposse/github-action-auto-release@v1 - with: - publish: false - prerelease: false - config-name: draft-release.yml diff --git a/.github/workflows/feature-branch.yml b/.github/workflows/feature-branch.yml index 046b19d..7a16cf9 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 + cache: false - 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: slack-notifier 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 + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a79f71a..178c027 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,34 +1,15 @@ name: Release - on: - workflow_dispatch: - release: - types: - - published - -permissions: - contents: write + types: [published] -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 +permissions: {} - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: '1.20' +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false - - 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/.goreleaser.yaml b/dev.goreleaser.yaml similarity index 100% rename from .goreleaser.yaml rename to dev.goreleaser.yaml