2024-12-19 06:49:21 -05:00
|
|
|
name: Versioned Release
|
|
|
|
|
|
|
|
on:
|
2024-12-22 17:01:11 -05:00
|
|
|
pull_request:
|
|
|
|
types: [closed]
|
2024-12-19 06:49:21 -05:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- v*
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
|
|
|
jobs:
|
2024-12-22 17:01:11 -05:00
|
|
|
bump-version:
|
|
|
|
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Bump Current Version
|
|
|
|
needs: [validate-release, test-cover, test-race]
|
|
|
|
outputs:
|
|
|
|
new_tag: ${{ steps.bump.outputs.new_tag }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Create bump and changelog
|
|
|
|
id: bump
|
|
|
|
uses: commitizen-tools/commitizen-action@master
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
increment: "PATCH"
|
|
|
|
|
2024-12-19 06:49:21 -05:00
|
|
|
new-release:
|
|
|
|
name: Run GoReleaser on New Tag
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
permissions: write-all
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: onsonr/sonr
|
|
|
|
fetch-depth: 0
|
|
|
|
fetch-tags: true
|
|
|
|
|
|
|
|
- uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version: "1.23"
|
|
|
|
check-latest: true
|
|
|
|
|
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
|
|
|
|
- name: Release
|
|
|
|
uses: goreleaser/goreleaser-action@v6
|
|
|
|
with:
|
|
|
|
distribution: goreleaser
|
|
|
|
version: latest
|
|
|
|
args: release --clean
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GH_RELEASER_TOKEN }}
|
|
|
|
GITHUB_PERSONAL_AUTH_TOKEN: ${{ secrets.GH_RELEASER_TOKEN }}
|
|
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
|