Skip to content

Commit 694089d

Browse files
Merge pull request #8 from codenamephp/feature/addOutputs
Add outputs
2 parents fea91c6 + 873e64b commit 694089d

1 file changed

Lines changed: 31 additions & 5 deletions

File tree

.github/workflows/updateReleaseVersions.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,37 @@ on:
1111
description: "The ref the release versions should point to"
1212
required: true
1313
type: string
14-
14+
outputs:
15+
major:
16+
description: "The major version"
17+
type: string
18+
value: ${{ jobs.update_release_versions.outputs.major }}
19+
minor:
20+
description: "The minor version"
21+
type: string
22+
value: ${{ jobs.update_release_versions.outputs.minor }}
23+
patch:
24+
description: "The patch version"
25+
type: string
26+
value: ${{ jobs.update_release_versions.outputs.patch }}
27+
major_tag:
28+
description: "The major tag that was created (the version number, e.g. 1)"
29+
type: string
30+
value: ${{ jobs.update_release_versions.outputs.major_tag }}
31+
minor_tag:
32+
description: "The minor tag that was created (the version number, e.g. 1.2)"
33+
type: string
34+
value: ${{ jobs.update_release_versions.outputs.minor_tag }}
1535
jobs:
16-
parse_version:
17-
name: Parse Version
36+
update_release_versions:
37+
name: Update Release Versions
1838
runs-on: ubuntu-latest
1939
outputs:
2040
major: ${{ steps.parse.outputs.major }}
2141
minor: ${{ steps.parse.outputs.minor }}
2242
patch: ${{ steps.parse.outputs.patch }}
43+
major_tag: ${{ steps.update.outputs.major }}
44+
minor_tag: ${{ steps.update.outputs.minor }}
2345
steps:
2446
- name: Parse version
2547
id: parse
@@ -28,15 +50,19 @@ jobs:
2850
echo "minor=$(echo ${{ inputs.version }} | cut -d '.' -f 2)" >> $GITHUB_OUTPUT
2951
echo "patch=$(echo ${{ inputs.version }} | cut -d '.' -f 3)" >> $GITHUB_OUTPUT
3052
31-
- uses: actions/checkout@v3
53+
- name: Checkout
54+
uses: actions/checkout@v3
3255
with:
3356
fetch-depth: 0
3457

3558
- name: Update tags
59+
id: update
3660
run: |
3761
MAJOR="${{ steps.parse.outputs.major }}"
3862
MINOR="${{ steps.parse.outputs.major }}.${{ steps.parse.outputs.minor }}"
3963
TARGET="${{ inputs.release_ref }}"
4064
git tag -f $MAJOR $TARGET
4165
git tag -f $MINOR $TARGET
42-
git push origin $MAJOR $MINOR --force
66+
git push origin $MAJOR $MINOR --force
67+
echo "major=$MAJOR" >> $GITHUB_OUTPUT
68+
echo "minor=$MINOR" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)