Spaces:
Paused
Paused
github-actions[bot] commited on
Commit Β·
f9d57df
1
Parent(s): 41d5c2c
Fix(ci): Use sed to inject repo URL into cliff.toml
Browse files- .github/workflows/build.yml +8 -12
.github/workflows/build.yml
CHANGED
|
@@ -96,7 +96,14 @@ jobs:
|
|
| 96 |
LATEST_CLIFF_URL=$(curl -s https://api.github.com/repos/orhun/git-cliff/releases/latest | jq -r '.assets[] | select(.name | endswith("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url')
|
| 97 |
curl -L $LATEST_CLIFF_URL | tar xz
|
| 98 |
sudo mv git-cliff-*/git-cliff /usr/local/bin/
|
| 99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
|
| 101 |
- name: Generate Changelog
|
| 102 |
id: changelog
|
|
@@ -105,26 +112,15 @@ jobs:
|
|
| 105 |
LAST_TAG=$(git describe --tags --abbrev=0 --match="build-*" 2>/dev/null || echo "")
|
| 106 |
RANGE="${LAST_TAG:+$LAST_TAG..HEAD}"
|
| 107 |
echo "π Generating changelog for build-${{ steps.version.outputs.version }} ($RANGE)"
|
| 108 |
-
|
| 109 |
-
# split owner and repo for git-cliff
|
| 110 |
-
OWNER="${GITHUB_REPOSITORY%%/*}"
|
| 111 |
-
REPO="${GITHUB_REPOSITORY#*/}"
|
| 112 |
|
| 113 |
git-cliff \
|
| 114 |
--config cliff.toml \
|
| 115 |
--strip all \
|
| 116 |
-
--owner "$OWNER" \
|
| 117 |
-
--repository "$REPO" \
|
| 118 |
--output changelog.md \
|
| 119 |
${RANGE:---unreleased}
|
| 120 |
|
| 121 |
if [ -s changelog.md ]; then
|
| 122 |
echo "β
Changelog generated successfully"
|
| 123 |
-
echo "π Changelog content:"
|
| 124 |
-
echo "===================="
|
| 125 |
-
cat changelog.md
|
| 126 |
-
echo "===================="
|
| 127 |
-
|
| 128 |
CHANGELOG_B64=$(base64 -w 0 changelog.md)
|
| 129 |
echo "changelog_b64=$CHANGELOG_B64" >> $GITHUB_OUTPUT
|
| 130 |
echo "has_changelog=true" >> $GITHUB_OUTPUT
|
|
|
|
| 96 |
LATEST_CLIFF_URL=$(curl -s https://api.github.com/repos/orhun/git-cliff/releases/latest | jq -r '.assets[] | select(.name | endswith("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url')
|
| 97 |
curl -L $LATEST_CLIFF_URL | tar xz
|
| 98 |
sudo mv git-cliff-*/git-cliff /usr/local/bin/
|
| 99 |
+
|
| 100 |
+
- name: Prepare git-cliff config
|
| 101 |
+
shell: bash
|
| 102 |
+
run: |
|
| 103 |
+
# Inject the GitHub repo URL into your template
|
| 104 |
+
sed -i "s|{{ repository_url }}|https://github.com/${GITHUB_REPOSITORY}|g" cliff.toml
|
| 105 |
+
echo "β
cliff.toml:"
|
| 106 |
+
head -20 cliff.toml
|
| 107 |
|
| 108 |
- name: Generate Changelog
|
| 109 |
id: changelog
|
|
|
|
| 112 |
LAST_TAG=$(git describe --tags --abbrev=0 --match="build-*" 2>/dev/null || echo "")
|
| 113 |
RANGE="${LAST_TAG:+$LAST_TAG..HEAD}"
|
| 114 |
echo "π Generating changelog for build-${{ steps.version.outputs.version }} ($RANGE)"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
|
| 116 |
git-cliff \
|
| 117 |
--config cliff.toml \
|
| 118 |
--strip all \
|
|
|
|
|
|
|
| 119 |
--output changelog.md \
|
| 120 |
${RANGE:---unreleased}
|
| 121 |
|
| 122 |
if [ -s changelog.md ]; then
|
| 123 |
echo "β
Changelog generated successfully"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
CHANGELOG_B64=$(base64 -w 0 changelog.md)
|
| 125 |
echo "changelog_b64=$CHANGELOG_B64" >> $GITHUB_OUTPUT
|
| 126 |
echo "has_changelog=true" >> $GITHUB_OUTPUT
|