-
Notifications
You must be signed in to change notification settings - Fork 13
65 lines (56 loc) · 1.58 KB
/
release.yml
File metadata and controls
65 lines (56 loc) · 1.58 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
64
65
name: Release
on:
workflow_dispatch:
inputs:
VERSION:
description: 'Release version/tag to create (example: 2.9.15.1)'
type: string
required: true
permissions:
actions: write
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Validate version
shell: bash
run: |
if [[ -z "${VERSION}" ]]; then
echo "VERSION is required"
exit 1
fi
if git ls-remote --tags origin "refs/tags/${VERSION}" | grep -q "refs/tags/${VERSION}$"; then
echo "Tag ${VERSION} already exists on origin"
exit 1
fi
env:
VERSION: ${{ github.event.inputs.VERSION }}
- name: Create and push tag
shell: bash
run: |
git tag "${VERSION}"
git push origin "${VERSION}"
env:
VERSION: ${{ github.event.inputs.VERSION }}
- name: Create GitHub release
shell: bash
run: |
gh release create "${VERSION}" \
--generate-notes \
--title "${VERSION}"
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ github.event.inputs.VERSION }}
- name: Trigger Docker workflow
shell: bash
run: |
gh workflow run proxy.yml --ref "${VERSION}"
env:
GH_TOKEN: ${{ github.token }}
VERSION: ${{ github.event.inputs.VERSION }}