forked from xMikux/Slimefun-Resourcepack
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (58 loc) · 2.29 KB
/
resuable_version.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
54
55
56
57
58
59
60
name: Resuable | Version Maker
on:
workflow_call:
inputs:
release_type:
type: string
required: false
default: "beta"
outputs:
version_sha_name:
description: "The sha version name (ex: git-abcdef or v1.0.0 )"
value: ${{ jobs.version_maker.outputs.version_sha_name }}
version_semver_current_name:
description: "The semver current version name"
value: ${{ jobs.version_maker.outputs.version_semver_current_name }}
version_semver_next_name:
description: "The semver next version name"
value: ${{ jobs.version_maker.outputs.version_semver_next_name }}
pack_version_name:
description: "The pack format will use name (ex: Beta git-abcdef or Release v1.0.0)"
value: ${{ jobs.version_maker.outputs.pack_version_name }}
jobs:
version_maker:
name: Make Version
runs-on: ubuntu-latest
outputs:
version_sha_name: ${{ steps.version_list.outputs.sha_name }}
version_semver_current_name: ${{ steps.version_list.outputs.semver_current_name }}
version_semver_next_name: ${{ steps.version_list.outputs.semver_next_name }}
pack_version_name: ${{ steps.pack_version_name.outputs.version_name }}
steps:
-
name: Setup - Checkout Repository
uses: actions/checkout@v4
-
name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: main
noVersionBumpBehavior: warn
-
name: Version - Get Versions
id: version_list
run: |
echo "sha_name=git-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
echo "semver_current_name=${{ steps.semver.outputs.current }}" >> "$GITHUB_OUTPUT"
echo "semver_next_name=${{ steps.semver.outputs.next }}" >> "$GITHUB_OUTPUT"
-
name: Pack Format - Version Name
id: pack_version_name
run: |
if [ "${{ inputs.release_type }}" == "beta" ]; then
echo "version_name=§dBeta §f${{ steps.version_list.outputs.sha_name }}" >> "$GITHUB_OUTPUT"
elif [ "${{ inputs.release_type }}" == "release" ]; then
echo "version_name=§bRelease §f${{ steps.version_list.outputs.semver_next_name }}" >> "$GITHUB_OUTPUT"
fi