-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (50 loc) · 1.91 KB
/
release.yaml
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
name: release
on:
workflow_dispatch:
inputs:
release_version:
description: 'Which version are we releasing? (format vX.Y.Z)'
required: true
permissions:
contents: write
jobs:
release:
name: "release"
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- name: Checkout repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- name: Configure github-actions[bot]
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Generate and Push Tags
run: |
version=${{ github.event.inputs.release_version }}
major=$(echo $version | cut -d. -f1)
minor=$(echo $version | cut -d. -f1-2)
git tag $version
git tag $minor -f
git tag $major -f
git push --set-upstream origin --tags -f
- name: Create GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run : |
gh release create "${{ github.event.inputs.release_version }}" --generate-notes
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push Extension Image
run: |
version=${{ github.event.inputs.release_version }}
version_no_v=$(echo "$version" | cut -c2-)
make push-extension TAG=$version_no_v