Skip to content

Commit 0594491

Browse files
committed
build: simplify release script
1 parent 07c9953 commit 0594491

File tree

1 file changed

+5
-30
lines changed

1 file changed

+5
-30
lines changed

.github/workflows/alfred-workflow-release.yml

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,26 @@ on:
66

77
env:
88
WORKFLOW_NAME: ${{ github.event.repository.name }}
9-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10-
11-
permissions:
12-
contents: write
139

1410
#───────────────────────────────────────────────────────────────────────────────
1511

1612
jobs:
1713
build:
1814
runs-on: macos-latest
15+
permissions: { contents: write }
1916
steps:
2017
- name: Checkout
2118
uses: actions/checkout@v4
22-
# by default, no tags and only a single commit is fetched. To use git
23-
# history in the next step, we need to fetch all history.
24-
with:
25-
fetch-depth: 0 # 0 = all history
26-
fetch-tags: true
27-
28-
- name: Create changelog
29-
run: |
30-
count_tags="$(git tag | wc -l)"
31-
if [[ $count_tags -ge 2 ]]; then
32-
previous_tag=$(git tag --sort=-creatordate | head -2 | tail -1)
33-
ref="$previous_tag"
34-
else
35-
root_commit=$(git rev-list --max-parents=0 HEAD)
36-
ref="$root_commit"
37-
fi
38-
prev_commit_messages=$(git log "$ref"..HEAD^ --format='- %s' |
39-
sed -E "s/^- ([^ ]+): /- **\1**: /")
40-
echo "### Changelog" > CHANGELOG.txt
41-
echo "$prev_commit_messages" >> CHANGELOG.txt
4219

4320
- name: Build .alfredworkflow
4421
run: |
4522
zip --recurse-paths --symlinks "${{ env.WORKFLOW_NAME }}.alfredworkflow" . \
46-
--exclude "README.md" "CHANGELOG.txt" \
47-
".git*" "Justfile" ".build-and-release.sh" ".rsync-exclude" \
48-
".editorconfig" ".typos.toml" ".markdownlint.*"
23+
--exclude "README.md" ".git*" "Justfile" ".build-and-release.sh"
24+
".rsync-exclude" ".editorconfig" ".typos.toml" ".markdownlint.*"
4925
50-
# DOCS https://github.com/softprops/action-gh-release?tab=readme-ov-file#%EF%B8%8F-uploading-release-assets
5126
- name: Release
5227
uses: softprops/action-gh-release@v2
5328
with:
54-
token: ${{ env.GITHUB_TOKEN }}
55-
body_path: CHANGELOG.txt
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
generate_release_notes: true
5631
files: ${{ env.WORKFLOW_NAME }}.alfredworkflow

0 commit comments

Comments
 (0)