Skip to content

Commit

Permalink
chore: add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILLIPS71 committed Apr 13, 2024
1 parent 3478d5b commit 911ec86
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 7 deletions.
47 changes: 40 additions & 7 deletions .github/actions/release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,51 @@ name: '🏷️ '
author: 'PHILLIPS71'

inputs:
GH_TOKEN:
required: true
NPM_TOKEN:
RELEASE_TYPE:
required: true
RELEASE_IDENTIFIER:
required: false

runs:
using: 'composite'
steps:
- name: '🏷️ Release'
id: version
uses: giantnodes/semver@latest
with:
path: VERSION.txt
type: ${{ inputs.RELEASE_TYPE }}
identifier: ${{ inputs.RELEASE_IDENTIFIER }}

- name: '🏷️ Version @giantnodes/design-system'
shell: bash
run: |
pnpm version ${{ steps.version.outputs.version }} --no-git-tag-version
- name: '🏷️ Version @giantnodes/theme'
working-directory: packages/theme
shell: bash
run: |
pnpm version ${{ steps.version.outputs.version }} --no-git-tag-version
- name: '🏷️ Version @giantnodes/react'
working-directory: packages/react
shell: bash
run: |
pnpm version ${{ steps.version.outputs.version }} --no-git-tag-version
- name: '🏷️ Tag & Commit Release'
shell: bash
env:
GH_TOKEN: ${{ inputs.GH_TOKEN }}
NPM_TOKEN: ${{ inputs.NPM_TOKEN }}
run: |
pnpm run semantic-release
git checkout -b release/${{ steps.version.outputs.version }}
git commit -m 'chore(release): ${{ steps.version.outputs.version }}'
git tag ${{ steps.version.outputs.version }}
git push origin release/${{ steps.version.outputs.version }} --tags --force
- name: '🏷️ Open Pull Request'
uses: thomaseizinger/create-pull-request@master
with:
title: 'chore(release): ${{ steps.version.outputs.version }}'
github_token: ${{ secrets.GITHUB_TOKEN }}
head: release/${{ steps.version.outputs.version }}
base: main
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: '🏷️ Release'

on:
workflow_dispatch:
inputs:
type:
type: choice
description: 'SemVer Increment'
default: 'prerelease'
required: true
options:
- prerelease
- prepatch
- patch
- preminor
- minor
- premajor
- major
identifier:
type: choice
description: 'Version Prefix'
required: false
options:
- canary

jobs:
stage:
runs-on: ubuntu-latest
steps:
- name: '🐙️ Checkout'
uses: actions/checkout@v4

- name: '🏷️ Release'
uses: ./.github/actions/release
with:
RELEASE_TYPE: ${{ github.event.inputs.type }}
RELEASE_IDENTIFIER: ${{ github.event.inputs.identifier }}
1 change: 1 addition & 0 deletions VERSION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.0

0 comments on commit 911ec86

Please sign in to comment.