Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add create-tag workflow #351

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/create-tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
name: Create new tag

on:
push:
branches:
- master
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' }}
Loading