Skip to content

new-pre-release

new-pre-release #40

Workflow file for this run

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${{ github.event.inputs.new-version }}
shell: bash
run: |
echo cenas_${{ needs.normalize-version-value.outputs.version }}
git checkout -b rc${{ github.event.inputs.new-version }}
git push -u origin rc${{ github.event.inputs.new-version }}
set-tag:
needs: create-rc
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${{ github.event.inputs.new-version }}
fetch-depth: 0
# token: ${{ secrets.PAT }}
- name: Set tag
run: |
git tag v${{ github.event.inputs.new-version }} HEAD -m "Version ${{ github.event.inputs.new-version }} released"
git push origin --tags