mirror of
https://github.com/zen-browser/desktop.git
synced 2026-02-16 00:24:06 +00:00
Refactor build workflow and add branch validation
This commit is contained in:
42
.github/workflows/build.yml
vendored
42
.github/workflows/build.yml
vendored
@@ -54,12 +54,52 @@ jobs:
|
||||
echo "GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}"
|
||||
echo "GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
check-build-is-correct:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [debug-inputs]
|
||||
steps:
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
token: ${{ secrets.DEPLOY_KEY }}
|
||||
|
||||
- name: Check if correct branch
|
||||
run: |
|
||||
echo "Checking if we are on the correct branch"
|
||||
git branch
|
||||
git status
|
||||
git branch --show-current
|
||||
if [[ $(git branch --show-current) != ${{ inputs.update_branch }} ]]; then
|
||||
echo ">>> Branch mismatch"
|
||||
exit 1
|
||||
else
|
||||
echo ">>> Branch matches"
|
||||
fi
|
||||
|
||||
- name: Check if branch is up to date
|
||||
run: |
|
||||
echo "Checking if branch is up to date"
|
||||
git fetch
|
||||
git pull
|
||||
git status
|
||||
if [[ $(git status) == *"Your branch is up to date with"* ]]; then
|
||||
echo ">>> Branch is up to date"
|
||||
else
|
||||
echo ">>> Branch is not up to date"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
build-data:
|
||||
permissions:
|
||||
contents: write
|
||||
name: Generate build data
|
||||
runs-on: ubuntu-latest
|
||||
needs: debug-inputs
|
||||
needs: check-build-is-correct
|
||||
outputs:
|
||||
build_date: ${{ steps.data.outputs.builddate }}
|
||||
version: ${{ steps.data.outputs.version }}
|
||||
|
||||
Reference in New Issue
Block a user