Repository navigation
62 lines (55 loc) · 2.26 KB
/
Copy pathgithub_release.yml
File metadata and controls
62 lines (55 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Create GitHub Release
on:
push:
tags:
- "v*" # Trigger when a version tag is pushed (e.g., v1.0.0)
jobs:
create-release:
# Snapshot tags only exist to exercise the deploy pipeline.
if: ${{ !endsWith(github.ref_name, '-SNAPSHOT') }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# The release commit rolls the changelog before the tag is cut, so the
# tag always carries a "## X.Y.Z (date)" section for its own version.
- name: Extract the release notes from the changelog
run: |
version="${GITHUB_REF_NAME#v}"
awk -v heading="## ${version} " '
!found && index($0, heading) == 1 { found = 1; next }
found && /^## / { exit }
found { print }
' CHANGELOG.md > release-notes.md
if ! grep -q '[^[:space:]]' release-notes.md; then
echo "No changelog section found for ${version}" >&2
exit 1
fi
cat release-notes.md
# CircleCI deploys to Clojars on the same tag push, after the full test
# matrix passes. Don't announce a release that isn't there to depend on:
# wait for the artifact to show up, and fail if it never does (re-run
# this workflow once the deploy has been fixed).
- name: Wait for the artifact to land on Clojars
run: |
version="${GITHUB_REF_NAME#v}"
pom="https://repo.clojars.org/cider/cider-nrepl/${version}/cider-nrepl-${version}.pom"
for _ in $(seq 1 90); do
if curl -sfIo /dev/null "$pom"; then
echo "Found ${pom}"
exit 0
fi
sleep 30
done
echo "Gave up waiting for ${pom}" >&2
exit 1
- name: Create GitHub Release
uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0
with:
tag: ${{ github.ref_name }}
name: cider-nrepl ${{ github.ref_name }}
prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-alpha') || contains(github.ref, '-beta') }}
bodyFile: release-notes.md
token: ${{ secrets.GITHUB_TOKEN }}