Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
feat: add release CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryburov committed Mar 3, 2023
1 parent bf21ca1 commit bfea2c1
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 33 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release

on:
push:
tags:
- '*'

permissions:
contents: write

jobs:
tests:
environment: tests
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- run: go version

- name: Checkout code
uses: actions/checkout@v3

- name: Install dependencies
run: go mod download && go mod tidy

- name: Unit Tests
run: make test

goreleaser:
environment: released
runs-on: ubuntu-latest
needs: tests
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Fetch all tags
run: git fetch --force --tags

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- run: go version

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.CHANGELOG_RELEASE }}
32 changes: 0 additions & 32 deletions .github/workflows/tests.yaml

This file was deleted.

49 changes: 49 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
env:
- GO111MODULE=on
- CGO_ENABLED=0

builds:
- id: default
skip: true

changelog:
sort: asc
use: github
filters:
exclude:
- '^test:'
- 'merge conflict'
- 'Merge pull request'
- 'Merge remote-tracking branch'
- 'Merge branch'
groups:
- title: ':syringe: Dependency updates'
regexp: "^.*feat\\(deps\\)*:+.*$"
order: 11000
- title: ':fire: New Features'
regexp: "^.*feat[(\\w)]*:+.*$"
order: 100
- title: ':bug: Bug fixes'
regexp: "^.*fix[(\\w)]*:+.*$"
order: 200
- title: ':book: Documentation updates'
regexp: "^.*docs[(\\w)]*:+.*$"
order: 500
- title: ':white_check_mark: Test'
regexp: "^.*test[(\\w)]*:+.*$"
order: 600
- title: ':hammer: Other work'
order: 900

milestones:
- close: true

release:
name_template: "v{{.Version}}"
draft: false
mode: append
header: |
### Present this new release :sweat_drops:
Please provide feedback in discussions and report bugs on the issue tracker. Thanks!
footer: |
**See all changes**: https://github.com/td-autoprofi/partner-go-services/compare/{{ .PreviousTag }}...{{ .Tag }}
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@ test: ## Run tests
go test ./...

run: ## Run application local
go run cmd/app/main.go
go run cmd/app/main.go

release: ## Git tag create and push
git tag -s -a v${tag} -m 'chore(release): v$(tag) [skip ci]'
git push origin v${tag}

release.revert: ## Revert git release tag
git tag -d v${tag}
git push --delete origin v${tag}

0 comments on commit bfea2c1

Please sign in to comment.