-
-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 1.11 KB
/
release.yml
File metadata and controls
35 lines (29 loc) · 1.11 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
---
name: Release
on:
release:
types: [published]
jobs:
Release:
runs-on: [ubuntu-24.04]
permissions:
contents: write # Required to create tags.
id-token: write # Required for authentication.
packages: write # Required to publish packages.
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # Fetch tag history.
persist-credentials: false
- name: Tag release
env:
GH_TAG: ${{ github.event.release.tag_name}}
GH_TOKEN: ${{ github.token }}
run: |
version=${GH_TAG%%.*}
gh api /repos/${{ github.repository }}/git/refs/tags/${version} --method PATCH --silent --field sha="${GITHUB_SHA}" --field force=true || \
gh api /repos/${{ github.repository }}/git/refs --method POST --silent --field sha="${GITHUB_SHA}" --field ref="refs/tags/${version}"
- name: Publish package
continue-on-error: true
uses: actions/publish-immutable-action@4bc8754ffc40f27910afb20287dbbbb675a4e978 # v0.0.4