-
Notifications
You must be signed in to change notification settings - Fork 21
43 lines (41 loc) · 1.17 KB
/
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
41
42
43
name: Release
on:
release:
branches: [main]
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'which tag to update to'
default: 'v2'
required: true
ref:
description: 'which branch to update the tag on'
default: 'main'
required: true
jobs:
re-tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.ref }}
- name: Config git name and email
run: |
git config user.name 'github-actions'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
- name: Update tag with parameter
if: github.event.inputs.tag != ''
run: |
git tag --delete ${{ inputs.tag }} || true
git push --delete origin ${{ inputs.tag }} || true
git tag -a ${{ inputs.tag }} -m 'Retag ${{ inputs.tag }}'
git push origin ${{ inputs.tag }}
- name: Update tag to v2
if: github.event.inputs.tag == ''
run: |
git tag --delete v2 || true
git push --delete origin v2 || true
git tag -a v2 -m 'Retag v2'
git push origin v2