This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
59 lines (57 loc) · 1.92 KB
/
create-tag.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
name: Create new tag
on:
push:
branches:
- next-release
paths:
- "package.json"
jobs:
create-new-tag:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Get Token
id: get_workflow_token
uses: peter-murray/workflow-application-token-action@v2
with:
application_id: ${{ secrets.GH_APPLICATION_ID }}
application_private_key: ${{ secrets.GH_APPLICATION_PRIVATE_KEY }}
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get library Package version
run: echo "COMPONENT_TAG=$(jq -r '.version' ./package.json)" >> $GITHUB_ENV
- name: Check tag does not exists
uses: rickstaa/action-contains-tag@v1
id: contains_tag
with:
reference: master
tag: ${{ env.COMPONENT_TAG }}
frail: false
- name: Release
uses: softprops/action-gh-release@v1
id: release
with:
token: ${{ steps.get_workflow_token.outputs.token }}
tag_name: ${{ env.COMPONENT_TAG }}
if: ${{ steps.contains_tag.outputs.retval != 'true' }}
- name: Generate Changelog
id: generate_changelog
uses: mikepenz/release-changelog-builder-action@v4.1.0
with:
configuration: .github/generate-changelog-configuration.json
token: ${{ steps.get_workflow_token.outputs.token }}
toTag: ${{ env.COMPONENT_TAG }}
if: ${{ steps.contains_tag.outputs.retval != 'true' }}
- name: Update release with Changelog
uses: softprops/action-gh-release@v1
id: release_update
with:
token: ${{ steps.get_workflow_token.outputs.token }}
body: ${{ steps.generate_changelog.outputs.changelog }}
tag_name: ${{ env.COMPONENT_TAG }}
if: ${{ steps.contains_tag.outputs.retval != 'true' }}