Skip to content

Commit fb4c742

Browse files
committed
Release automation
1 parent aad2324 commit fb4c742

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

.github/workflows/build.yaml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ jobs:
6161
runs-on: ubuntu-latest
6262
permissions:
6363
id-token: write
64-
contents: read
64+
contents: write
65+
discussions: write
6566
steps:
6667
- uses: actions/checkout@v4
6768
- uses: denoland/setup-deno@v1
@@ -75,12 +76,33 @@ jobs:
7576
'.version = .version + "-dev." + $build + "+" + $commit' \
7677
deno.json > deno.json.tmp
7778
mv deno.json.tmp deno.json
78-
# Don't know why, but the .gitignore list is not overriden by include list
79-
# in deno.json:
80-
rm vocab/.gitignore
8179
- if: github.ref_type == 'tag'
82-
run: '[[ "$(jq .version deno.json)" = "$GITHUB_REF_NAME" ]]'
83-
- run: deno task publish
80+
run: |
81+
set -ex
82+
[[ "$(jq -r .version deno.json)" = "$GITHUB_REF_NAME" ]]
83+
! grep -i "to be released" CHANGES.md
84+
# Don't know why, but the .gitignore list is not overriden by include list
85+
# in deno.json:
86+
- run: rm vocab/.gitignore
87+
- id: extract-changelog
88+
uses: dahlia/submark@5a5ff0a58382fb812616a5801402f5aef00f90ce
89+
with:
90+
input-file: CHANGES.md
91+
heading-level: 2
92+
heading-title-text: version ${{ github.ref_name }}
93+
ignore-case: true
94+
omit-heading: true
95+
- run: 'cat "$CHANGES_FILE"'
96+
env:
97+
CHANGES_FILE: ${{ steps.extract-changelog.outputs.output-file }}
98+
- if: github.ref_type == 'tag'
99+
uses: softprops/action-gh-release@v1
100+
with:
101+
body_path: ${{ steps.extract-changelog.outputs.output-file }}
102+
name: Fedify ${{ github.ref_name }}
103+
generate_release_notes: false
104+
discussion_category_name: Announcements
105+
- run: deno task publish --allow-dirty
84106

85107
publish-examples-blog:
86108
needs: [test, lint]

0 commit comments

Comments
 (0)