-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (57 loc) · 1.75 KB
/
Copy pathrelease.yml
File metadata and controls
63 lines (57 loc) · 1.75 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
63
name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
release:
name: Release ${{ github.ref_name }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build source tarball
id: build
run: |
VERSION="${GITHUB_REF_NAME#v}"
TARBALL="context-absorb-${VERSION}.tar.gz"
git archive --format=tar.gz --prefix="context-absorb-${VERSION}/" -o "$TARBALL" HEAD
SHA256="$(shasum -a 256 "$TARBALL" | cut -d' ' -f1)"
{
echo "tarball=$TARBALL"
echo "sha256=$SHA256"
echo "version=$VERSION"
} >> "$GITHUB_OUTPUT"
echo "Tarball SHA256: $SHA256"
- name: Generate release notes
id: notes
run: |
{
echo "notes<<EOF"
echo "## Install"
echo ""
echo '```bash'
echo "curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.ref_name }}/install.sh | bash"
echo '```'
echo ""
echo "## Tarball SHA256"
echo ""
echo '```'
echo "${{ steps.build.outputs.sha256 }}"
echo '```'
echo ""
echo "Use this SHA in your Homebrew formula. See CHANGELOG.md for the full list of changes."
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
body: ${{ steps.notes.outputs.notes }}
files: ${{ steps.build.outputs.tarball }}
draft: false
prerelease: false