-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaction.yml
53 lines (49 loc) · 1.56 KB
/
action.yml
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
name: 'Release Version'
description: 'Create new GitHub release using Conventional Commits'
icon: 'git-merge'
color: 'yellow'
inputs:
GITHUB_TOKEN:
description: 'GitHub Actions token with write permissions, see docs: https://docs.github.com/en/actions/security-guides/automatic-token-authentication'
required: false
ACTION_TYPE:
description: 'Which type of action to perform.'
required: true
type: choice
options:
- Release
- Validate
outputs:
release_version:
description: "Release version in semantic format; e.g. 1.0.0"
value: ${{ steps.release.outputs.version }}
runs:
using: "composite"
steps:
- name: Clone Action
uses: actions/checkout@v4
with:
repository: Oliver-Binns/Versioning
path: $RUNNER_TEMP/Versioning
- name: Build Package
working-directory: $RUNNER_TEMP/Versioning
shell: bash
run: swift build
- name: Validate
if: ${{ inputs.ACTION_TYPE == 'Validate' }}
working-directory: $RUNNER_TEMP/Versioning
shell: bash
run: |
swift run --skip-build Run validate \
--message "${{ github.event.pull_request.title }}"
- name: Release
id: release
if: ${{ inputs.ACTION_TYPE == 'Release' }}
working-directory: $RUNNER_TEMP/Versioning
shell: bash
run: |
version=$(swift run --skip-build Run increment \
--repository $GITHUB_REPOSITORY \
--sha $GITHUB_SHA \
--token ${{inputs.GITHUB_TOKEN}})
echo "version=$version" >> $GITHUB_OUTPUT