-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (33 loc) · 1.14 KB
/
create-release.yml
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
name: Create Release
on:
workflow_dispatch:
inputs:
tag:
description: 'The new version to tag, ex: 1.0.5'
required: true
type: string
jobs:
create-release:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Release
run: |
set -euo pipefail
git config user.name "${{ github.triggering_actor }}"
git config user.email "${{ github.triggering_actor }}@users.noreply.github.com"
export PREFIX="${NAME}-${TAG}"
export ARCHIVE="$PREFIX.tar.gz"
sha=$(git rev-parse HEAD)
git archive --format=tar --prefix="${NAME}-${TAG}/" $sha | gzip > $ARCHIVE
export SHA256=$(shasum -a 256 $ARCHIVE | awk '{print $1}')
env
cat .github/workflows/release_notes.md | envsubst > notes.md
cat notes.md
gh release create "v$TAG" --title "$TAG" --target $sha --generate-notes --notes "$(cat notes.md)" $ARCHIVE
env:
NAME: "rules_poetry"
TAG: ${{ inputs.tag }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}