new-pre-release #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: new-pre-release | |
on: | |
workflow_dispatch: | |
inputs: | |
new-version: | |
description: 'New version to be set.' | |
type: string | |
required: true | |
jobs: | |
normalize-version-value: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.extract_value_without_v.outputs.v }} | |
if: ${{ github.event.inputs.new-version }} | |
steps: | |
- name: Ensure given version do not have 'v' | |
id: clean-version-value | |
uses: jungwinter/split@v2 | |
with: | |
msg: '${{ github.event.inputs.new-version }}' | |
separator: 'v' | |
- name: Set output normalized version | |
id: extract_value_without_v | |
run: | | |
echo "v"=${{ steps.clean-version-value.outputs._1 }} >> $GITHUB_OUTPUT | |
create-rc: | |
needs: normalize-version-value | |
runs-on: ubuntu-latest | |
if: ${{ github.event.inputs.new-version }} | |
steps: | |
- name: Checkout branch dev | |
uses: actions/checkout@v3 | |
with: | |
ref: dev | |
- uses: actions/setup-node@v3 | |
- name: Create branch rc${{ needs.normalize-version-value.outputs.version }} | |
shell: bash | |
run: | | |
git checkout -b rc${{ needs.normalize-version-value.outputs.version }} | |
git push -u origin rc${{ needs.normalize-version-value.outputs.version }} | |
set-tag: | |
needs: [create-rc, normalize-version-value] | |
runs-on: ubuntu-latest | |
if: ${{ github.event.inputs.new-version }} | |
steps: | |
# TODO: Remove the setUp git below since it will not be needed once token will be set | |
# - name: Configure Git with the GitHub Token | |
# run: | | |
# git config --global user.email "sa_git_uicomponents@outsystems.com" | |
# git config --global user.name "UiComponentsBot" | |
# git config --global credential.helper store | |
- name: Checkout branch dev | |
uses: actions/checkout@v3 | |
with: | |
ref: rc${{ needs.normalize-version-value.outputs.version }} | |
fetch-depth: 0 | |
token: ${{ secrets.PAT }} | |
- name: Set tag | |
run: | | |
git tag v${{ needs.normalize-version-value.outputs.version }} HEAD -m "Version ${{ needs.normalize-version-value.outputs.version }} released" | |
git push origin --tags |