-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.18 KB
/
create-release.yml
File metadata and controls
45 lines (38 loc) · 1.18 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
# Copyright 2024 Practically.io All rights reserved
name: Create Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version (Leave blank for an automatically generated version bump)'
required: false
jobs:
release:
if: github.ref == 'refs/heads/main'
name: Release
runs-on: ubuntu-latest
container: practically/conventional-tools:1.x
env:
CT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Git safe.directory
run: git config --global --add safe.directory $PWD
- name: Setup Git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Release
run: conventional-tools release-semver ${{ github.event.inputs.version }}
check-branch:
if: github.ref != 'refs/heads/main'
name: Check Branch
runs-on: ubuntu-latest
steps:
- name: Fail if not on main branch
run: |
echo "This workflow can only be triggered from the main branch."
exit 1