Skip to content

Commit 1eb850c

Browse files
Update release.yml
1 parent 5a33e6a commit 1eb850c

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

.github/workflows/release.yml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,29 @@ jobs:
2222
V=$(grep '^version' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
2323
echo "version=$V" >> $GITHUB_OUTPUT
2424
25+
changelog:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Install git-cliff
33+
run: |
34+
VERSION=$(gh release view --repo orhun/git-cliff --json tagName -q .tagName)
35+
curl -sL "https://github.com/orhun/git-cliff/releases/download/${VERSION}/git-cliff-${VERSION}-x86_64-unknown-linux-gnu.tar.gz" | tar -xz
36+
sudo mv git-cliff /usr/local/bin/
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Generate changelog
41+
run: git-cliff -o CHANGELOG.md
42+
43+
- uses: actions/upload-artifact@v4
44+
with:
45+
name: changelog
46+
path: CHANGELOG.md
47+
2548
build:
2649
needs: version
2750
strategy:
@@ -56,7 +79,7 @@ jobs:
5679
- run: rustup target add ${{ matrix.target }}
5780
- run: cargo build --release --target ${{ matrix.target }}
5881

59-
- name: Ensure zip exists (Windows)
82+
- name: Ensure zip exists
6083
if: matrix.os == 'windows-latest'
6184
run: choco install zip -y
6285

@@ -84,34 +107,19 @@ jobs:
84107
*.sha256
85108
86109
release:
87-
needs: [version, build]
110+
needs: [version, build, changelog]
88111
runs-on: ubuntu-latest
89112

90113
steps:
91-
- uses: actions/checkout@v4
92-
with:
93-
fetch-depth: 0
94-
95114
- uses: actions/download-artifact@v4
96115
with:
97116
path: artifacts
98117

99-
- name: Install git-cliff (official binary)
100-
run: |
101-
VERSION=$(gh release view --repo orhun/git-cliff --json tagName -q .tagName)
102-
curl -sL "https://github.com/orhun/git-cliff/releases/download/${VERSION}/git-cliff-${VERSION}-x86_64-unknown-linux-gnu.tar.gz" | tar -xz
103-
sudo mv git-cliff /usr/local/bin/
104-
env:
105-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106-
107-
- name: Generate Changelog
108-
run: git-cliff -o CHANGELOG.md
109-
110118
- uses: softprops/action-gh-release@v2
111119
with:
112120
tag_name: v${{ needs.version.outputs.version }}
113121
name: PyElevate v${{ needs.version.outputs.version }}
114-
body_path: CHANGELOG.md
122+
body_path: artifacts/changelog/CHANGELOG.md
115123
files: artifacts/**/*
116124
env:
117125
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)