-
Notifications
You must be signed in to change notification settings - Fork 9
42 lines (40 loc) · 1.35 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
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.
name: Release workflows
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check semantic version prefix for latest commit
run: python3 _check_semantic_version_prefix.py
env:
# Use env variable to avoid script injection
MESSAGE: ${{ github.event.head_commit.message }}
- name: Get release version
id: get-version
run: python3 _get_release_semantic_version.py
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update major version tag
run: |
git tag '${{ steps.get-version.outputs.major_version }}' --force
git push origin '${{ steps.get-version.outputs.major_version }}' --force
- name: Create release
run: |
git tag '${{ steps.get-version.outputs.full_version }}'
git push origin '${{ steps.get-version.outputs.full_version }}'
gh release create '${{ steps.get-version.outputs.full_version }}' --verify-tag --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write # Needed to create release