Skip to content

Commit 19f65fb

Browse files
committed
ci: change the range of commit for changelog
1 parent 01d5cd9 commit 19f65fb

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
permissions:
8+
contents: write
9+
jobs:
10+
generate-changelog:
11+
name: Generate Changelog
12+
runs-on: ubuntu-latest
13+
outputs:
14+
release_body: ${{ steps.git-cliff.outputs.content }}
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
- name: Generate changelog
19+
id: git-cliff
20+
uses: orhun/git-cliff-action@v2
21+
with:
22+
config: cliff.toml
23+
args: -vv --strip header 97e2d15e..HEAD
24+
env:
25+
OUTPUT: CHANGELOG.md
26+
release:
27+
name: Build & Release
28+
runs-on: ubuntu-latest
29+
needs: generate-changelog
30+
permissions:
31+
contents: write
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v3
35+
- name: Set up Go
36+
uses: actions/setup-go@v4
37+
with:
38+
go-version: '1.23.x'
39+
cache-dependency-path: ./go.sum
40+
- name: Build Artifact
41+
run: go build -v ./cmd/main.go -o ./bin/backend-api-linux-x86_64-${{ github.ref_name }}
42+
- name: Create Release
43+
uses: svenstaro/upload-release-action@v2
44+
with:
45+
file: /bin/backend-api-linux-x86_64-${{ github.ref_name }}
46+
repo_token: ${{ secrets.GITHUB_TOKEN }}
47+
tag: ${{ github.ref }}
48+
overwrite: true
49+
release_name: "Release ${{ github.ref_name }}"
50+
body: "${{ needs.generate-changelog.outputs.release_body }}"

cliff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ header = """
1414
# https://tera.netlify.app/docs
1515
body = """
1616
{% set github_repo = 'backend-api' %}
17-
{% set branch = 'go' %}
17+
{% set branch = 'main' %}
1818
{% set github_username = 'dogy-app' %}
1919
2020
{% if version %}\

0 commit comments

Comments
 (0)