-
Notifications
You must be signed in to change notification settings - Fork 5
67 lines (60 loc) · 1.71 KB
/
release.yaml
File metadata and controls
67 lines (60 loc) · 1.71 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
66
67
name: Release with versioning
on:
# push:
# branches:
# - main
workflow_dispatch:
inputs:
version:
description: A version to release
required: true
permissions:
contents: write
packages: write
jobs:
versioning:
if: ${{ github.event_name != 'workflow_dispatch' }}
name: Versioning
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.versioning.outputs.new_tag }}
changelog: ${{ steps.versioning.outputs.changelog }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Bump version and tag
id: versioning
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: false
build-and-push:
if: ${{ needs.versioning.outputs.tag }}
name: Build and publish image
needs:
- versioning
uses: ./.github/workflows/publish-image.yaml
with:
name: ${{ github.repository }}
tag: ${{ needs.versioning.outputs.tag }}
ref: ${{ needs.versioning.outputs.tag }}
release:
name: Release
runs-on: ubuntu-latest
needs:
- build-and-push
steps:
- name: Create release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.versioning.outputs.tag }}
name: ${{ needs.versioning.outputs.tag }}
body: ${{ needs.versioning.outputs.changelog }}
build-and-push-from-dispatch:
if: ${{ github.event_name == 'workflow_dispatch' }}
name: Build and publish image
uses: ./.github/workflows/publish-image.yaml
with:
name: ${{ github.repository }}
tag: ${{ github.event.inputs.version }}
ref: ${{ github.event.inputs.version }}