|
22 | 22 | V=$(grep '^version' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/') |
23 | 23 | echo "version=$V" >> $GITHUB_OUTPUT |
24 | 24 |
|
| 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 | + |
25 | 48 | build: |
26 | 49 | needs: version |
27 | 50 | strategy: |
|
56 | 79 | - run: rustup target add ${{ matrix.target }} |
57 | 80 | - run: cargo build --release --target ${{ matrix.target }} |
58 | 81 |
|
59 | | - - name: Ensure zip exists (Windows) |
| 82 | + - name: Ensure zip exists |
60 | 83 | if: matrix.os == 'windows-latest' |
61 | 84 | run: choco install zip -y |
62 | 85 |
|
@@ -84,34 +107,19 @@ jobs: |
84 | 107 | *.sha256 |
85 | 108 |
|
86 | 109 | release: |
87 | | - needs: [version, build] |
| 110 | + needs: [version, build, changelog] |
88 | 111 | runs-on: ubuntu-latest |
89 | 112 |
|
90 | 113 | steps: |
91 | | - - uses: actions/checkout@v4 |
92 | | - with: |
93 | | - fetch-depth: 0 |
94 | | - |
95 | 114 | - uses: actions/download-artifact@v4 |
96 | 115 | with: |
97 | 116 | path: artifacts |
98 | 117 |
|
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 | | - |
110 | 118 | - uses: softprops/action-gh-release@v2 |
111 | 119 | with: |
112 | 120 | tag_name: v${{ needs.version.outputs.version }} |
113 | 121 | name: PyElevate v${{ needs.version.outputs.version }} |
114 | | - body_path: CHANGELOG.md |
| 122 | + body_path: artifacts/changelog/CHANGELOG.md |
115 | 123 | files: artifacts/**/* |
116 | 124 | env: |
117 | 125 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments