Skip to content

Commit ca0e023

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

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.github/workflows/release.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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@v4
21+
with:
22+
config: cliff.toml
23+
args: -vv --latest --strip header
24+
env:
25+
OUTPUT: CHANGELOG.md
26+
GITHUB_REPO: ${{ github.repository }}
27+
release:
28+
name: Build & Release
29+
runs-on: ubuntu-latest
30+
needs: generate-changelog
31+
permissions:
32+
contents: write
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v3
36+
- name: Set up Go
37+
uses: actions/setup-go@v4
38+
with:
39+
go-version: '1.23.x'
40+
cache-dependency-path: ./go.sum
41+
- name: Build Artifact
42+
run: |
43+
mkdir -pv bin
44+
go build -v -o ./bin/backend-api-linux-x86_64-${{ github.ref_name }} ./cmd/main.go
45+
- name: Create Release
46+
uses: svenstaro/upload-release-action@v2
47+
with:
48+
file: bin/backend-api-linux-x86_64-${{ github.ref_name }}
49+
repo_token: ${{ secrets.GITHUB_TOKEN }}
50+
tag: ${{ github.ref }}
51+
overwrite: true
52+
release_name: "Release ${{ github.ref_name }}"
53+
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)