ci: Replace semantic-release with another release process #102
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: "CI/CD" | |
"on": | |
push: | |
jobs: | |
pre-commit-job: | |
runs-on: "ubuntu-22.04" | |
steps: | |
- name: "Check out repository" | |
uses: "actions/[email protected]" | |
- name: "Setup python" | |
uses: "actions/[email protected]" | |
- name: "Run pre-commit" | |
uses: "pre-commit/[email protected]" | |
go-test-job: | |
runs-on: "ubuntu-22.04" | |
steps: | |
- name: "Check out repository" | |
uses: "actions/[email protected]" | |
- name: "Setup go" | |
uses: "actions/[email protected]" | |
with: | |
go-version: "1.22.3" | |
- name: "Run go test" | |
run: "go test ./..." | |
go-build-job: | |
runs-on: "ubuntu-22.04" | |
steps: | |
- name: "Check out repository" | |
uses: "actions/[email protected]" | |
- name: "Setup go" | |
uses: "actions/[email protected]" | |
with: | |
go-version: "1.22.3" | |
- name: "Run go build" | |
run: "go build" | |
determine-version-job: | |
runs-on: "ubuntu-22.04" | |
outputs: | |
version: "${{ steps.get_version.outputs.version }}" | |
steps: | |
- name: "Check out repository" | |
uses: "actions/[email protected]" | |
with: | |
fetch-depth: 0 | |
- name: "Setup go" | |
uses: "actions/[email protected]" | |
with: | |
go-version: "1.23.5" | |
- name: "Run verscout next" | |
id: "get_version" | |
run: | | |
VERSION=$(go run main.go next) | |
if [ -z "$VERSION" ]; then | |
exit 0 | |
fi | |
if [ "${{ github.ref_name }}" != "${{ github.event.repository.default_branch }}" ]; then | |
VERSION="${VERSION}-rc" | |
fi | |
echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
release-job: | |
runs-on: "ubuntu-22.04" | |
needs: | |
- "determine-version-job" | |
if: "needs.determine-version-job.outputs.VERSION != ''" | |
permissions: | |
contents: "write" | |
steps: | |
- name: "Check out repository" | |
uses: "actions/[email protected]" | |
with: | |
fetch-depth: 0 | |
- name: "Login to Docker Hub" | |
uses: "docker/[email protected]" | |
with: | |
username: "${{ secrets.DOCKER_USERNAME }}" | |
password: "${{ secrets.DOCKER_VERSCOUT_GORELEASER_TOKEN }}" | |
- name: "Setup go" | |
uses: "actions/[email protected]" | |
with: | |
go-version: "1.23.5" | |
- name: "Setup goreleaser" | |
run: "go install github.com/goreleaser/goreleaser/[email protected]" | |
- name: "Generate release notes" | |
uses: "orhun/[email protected]" | |
with: | |
args: "--tag ${{ needs.determine-version-job.outputs.VERSION }} --unreleased --strip header" | |
env: | |
OUTPUT: "release-notes.md" | |
- name: "Create tag" | |
run: "git tag ${{ needs.determine-version-job.outputs.VERSION }}" | |
- name: "Run goreleaser" | |
run: "goreleaser release --release-notes release-notes.md --clean" | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
DOCKER_LABDOC_GORELEASER_TOKEN: "${{ secrets.DOCKER_LABDOC_GORELEASER_TOKEN }}" | |
HOMEBREW_TAP_ERNAIL_GITHUB_TOKEN: "${{ secrets.HOMEBREW_TAP_ERNAIL_GITHUB_TOKEN }}" | |
... |