Files
bazarr/.github/workflows/release_beta_to_dev.yaml

80 lines
2.6 KiB
YAML

name: release_beta_to_dev
on: workflow_dispatch
jobs:
Release:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
STATUS_WORKFLOW_NAME: "ci.yml"
UI_DIRECTORY: ./frontend
ASSET_DIRECTORY: ./__builds__
steps:
- name: Validate branch
if: ${{ github.ref != 'refs/heads/development' }}
run: |
echo This action can only be run on development branch, not ${{ github.ref }}
exit 1
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: development
- name: Setup Git
run: |
git config --global user.name "github-actions" &&
git fetch --tags
- name: Cache node_modules
uses: actions/cache@v6
with:
path: "${{ env.UI_DIRECTORY }}/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-modules-
- name: Setup NodeJS
uses: actions/setup-node@v7
with:
node-version-file: "${{ env.UI_DIRECTORY }}/.nvmrc"
- name: Install Global Tools
run: npm install -g release-it@v16.3.0 auto-changelog
- name: Install UI Dependencies
run: npm install
working-directory: ${{ env.UI_DIRECTORY }}
- name: Build UI
run: npm run build
working-directory: ${{ env.UI_DIRECTORY }}
- name: Download outcome artifact from Workflow CI
uses: dawidd6/action-download-artifact@v21
with:
workflow: ci.yml
workflow_conclusion: completed
name: shared-metadata
path: ./upstream-data
- name: Read the CI output value
id: check-ci
run: |
CONCLUSION=$(cat ./upstream-data/outcome.txt)
echo "The value from the last CI run was: $CONCLUSION"
echo "CONCLUSION=$CONCLUSION" >> "$GITHUB_OUTPUT"
- name: Create Release (Conditional)
if: ${{ steps.check-ci.outputs.CONCLUSION == 'success' }}
run: |
git config user.name "${{github.actor}}"
git config user.email "${{github.actor}}@users.noreply.github.com"
revision_count=$(git rev-list --invert-grep --regexp-ignore-case --extended-regexp --grep="^(Release|no log:|Merge.remote-tracking).*" $(git describe --tags --abbrev=0)..HEAD --count)
if [[ $revision_count != 0 ]]; then
echo "**** Found $revision_count changes! Releasing... ****"
release-it --ci --increment prerelease --preRelease=beta
else
echo "**** Cannot find changes! Skipping... ****"
fi