Skip to content

Merge branch 'feat/autorefresh-fields' into alpha #671

Merge branch 'feat/autorefresh-fields' into alpha

Merge branch 'feat/autorefresh-fields' into alpha #671

Workflow file for this run

name: Release
env:
LIBRARY_NAME: "gisce/react-ooui"
on:
push:
branches:
- v2
- v2-develop
- alpha
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
release:
if: '!contains(github.event.head_commit.message, ''[skip ci]'')'
name: Release
runs-on: ubuntu-latest
outputs:
release_type: ${{ steps.get_release_type.outputs.release_type }}
tag_name: ${{ steps.get_tag_name.outputs.tag_name }}
branch_name: ${{ steps.get_branch_name.outputs.branch_name }}
steps:
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20.5.0'
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Install Dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
run: npx semantic-release
- name: Capture Release Type
id: get_release_type
run: |
if [ -f ".release-type" ]; then
release_type=$(cat .release-type)
echo "release_type=$release_type" >> $GITHUB_OUTPUT
else
echo "release_type=none" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Capture Tag Name
id: get_tag_name
run: |
if [ -f ".release-tag" ]; then
tag_name=$(cat .release-tag)
echo "tag_name=$tag_name" >> $GITHUB_OUTPUT
else
echo "tag_name=none" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Capture Branch Name
id: get_branch_name
run: echo "branch_name=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
shell: bash
update-dependents:
name: Update dependent projects
needs: release
if: needs.release.outputs.release_type != 'none'
runs-on: ubuntu-latest
strategy:
matrix:
include:
- project: "gisce/webclient"
# modify this in case that branches are not equivalent and exist between projects
branch: ${{ needs.release.outputs.branch_name }}
steps:
- name: Call update version dependency flow for each project
uses: gisce/[email protected]
with:
dependentProject: ${{ matrix.project }}
tagName: ${{ needs.release.outputs.tag_name }}
dependentProjectBranch: ${{ matrix.branch }}
libraryName: ${{ env.LIBRARY_NAME }}
githubToken: ${{ secrets.GH_PAT }}
releaseType: ${{ needs.release.outputs.release_type }}
create-sync-prs:
name: Create sync PRs
needs: release
if: github.ref == 'refs/heads/v2'
runs-on: ubuntu-latest
strategy:
matrix:
target: ['alpha', 'v2-develop']
steps:
- name: Call create sync pr
uses: gisce/[email protected]
with:
repository: ${{ env.LIBRARY_NAME }}
targetBranch: ${{ matrix.target }}
baseBranch: v2
githubToken: ${{ secrets.GH_PAT }}
releaseType: ${{ needs.release.outputs.release_type }}