From 970c2c26550f2f3ce40c5ab2096de928c6e1020e Mon Sep 17 00:00:00 2001 From: Chris Grieser <73286100+chrisgrieser@users.noreply.github.com> Date: Wed, 27 Nov 2024 22:37:49 +0100 Subject: [PATCH] build: simplify release script --- .github/workflows/alfred-workflow-release.yml | 35 +++---------------- 1 file changed, 5 insertions(+), 30 deletions(-) diff --git a/.github/workflows/alfred-workflow-release.yml b/.github/workflows/alfred-workflow-release.yml index 19c90f2..04cd8b0 100644 --- a/.github/workflows/alfred-workflow-release.yml +++ b/.github/workflows/alfred-workflow-release.yml @@ -6,51 +6,26 @@ on: env: WORKFLOW_NAME: ${{ github.event.repository.name }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -permissions: - contents: write #─────────────────────────────────────────────────────────────────────────────── jobs: build: runs-on: macos-latest + permissions: { contents: write } steps: - name: Checkout uses: actions/checkout@v4 - # by default, no tags and only a single commit is fetched. To use git - # history in the next step, we need to fetch all history. - with: - fetch-depth: 0 # 0 = all history - fetch-tags: true - - - name: Create changelog - run: | - count_tags="$(git tag | wc -l)" - if [[ $count_tags -ge 2 ]]; then - previous_tag=$(git tag --sort=-creatordate | head -2 | tail -1) - ref="$previous_tag" - else - root_commit=$(git rev-list --max-parents=0 HEAD) - ref="$root_commit" - fi - prev_commit_messages=$(git log "$ref"..HEAD^ --format='- %s' | - sed -E "s/^- ([^ ]+): /- **\1**: /") - echo "### Changelog" > CHANGELOG.txt - echo "$prev_commit_messages" >> CHANGELOG.txt - name: Build .alfredworkflow run: | zip --recurse-paths --symlinks "${{ env.WORKFLOW_NAME }}.alfredworkflow" . \ - --exclude "README.md" "CHANGELOG.txt" \ - ".git*" "Justfile" ".build-and-release.sh" ".rsync-exclude" \ - ".editorconfig" ".typos.toml" ".markdownlint.*" + --exclude "README.md" ".git*" "Justfile" ".build-and-release.sh" + ".rsync-exclude" ".editorconfig" ".typos.toml" ".markdownlint.*" - # DOCS https://github.com/softprops/action-gh-release?tab=readme-ov-file#%EF%B8%8F-uploading-release-assets - name: Release uses: softprops/action-gh-release@v2 with: - token: ${{ env.GITHUB_TOKEN }} - body_path: CHANGELOG.txt + token: ${{ secrets.GITHUB_TOKEN }} + generate_release_notes: true files: ${{ env.WORKFLOW_NAME }}.alfredworkflow