mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-06 03:18:19 +00:00
Add self-hosted runner management to build workflow
This commit is contained in:
47
.github/workflows/build.yml
vendored
47
.github/workflows/build.yml
vendored
@@ -54,6 +54,28 @@ jobs:
|
|||||||
echo "GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}"
|
echo "GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}"
|
||||||
echo "GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}"
|
echo "GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}"
|
||||||
|
|
||||||
|
start-self-host:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: debug-inputs
|
||||||
|
steps:
|
||||||
|
- name: Start self-hosted runner
|
||||||
|
if: ${{ inputs.create_release && inputs.update_branch == 'release' }}
|
||||||
|
run: |
|
||||||
|
echo "Starting self-hosted runner"
|
||||||
|
echo "${{ secrets.SELF_HOSTED_RUNNER_START_SCRIPT }}" | base64 --decode > start.sh
|
||||||
|
sudo chmod +x start.sh
|
||||||
|
./start.sh > /dev/null 2>&1 &
|
||||||
|
|
||||||
|
- name: Remove self-hosted runner script
|
||||||
|
if: always() && ${{ inputs.create_release && inputs.update_branch == 'release' }}
|
||||||
|
run: |
|
||||||
|
echo "Removing self-hosted runner script"
|
||||||
|
rm start.sh
|
||||||
|
|
||||||
|
- name: Sleep until runner is ready
|
||||||
|
if: ${{ inputs.create_release && inputs.update_branch == 'release' }}
|
||||||
|
run: sleep 30s
|
||||||
|
|
||||||
check-build-is-correct:
|
check-build-is-correct:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [debug-inputs]
|
needs: [debug-inputs]
|
||||||
@@ -318,7 +340,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
needs: [build-data, windows-step-2]
|
needs: [build-data, windows-step-2, start-self-host]
|
||||||
with:
|
with:
|
||||||
build-version: ${{ needs.build-data.outputs.version }}
|
build-version: ${{ needs.build-data.outputs.version }}
|
||||||
generate-gpo: false
|
generate-gpo: false
|
||||||
@@ -330,7 +352,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
needs: [build-data]
|
needs: [build-data, start-self-host]
|
||||||
with:
|
with:
|
||||||
build-version: ${{ needs.build-data.outputs.version }}
|
build-version: ${{ needs.build-data.outputs.version }}
|
||||||
release-branch: ${{ inputs.update_branch }}
|
release-branch: ${{ inputs.update_branch }}
|
||||||
@@ -420,11 +442,30 @@ jobs:
|
|||||||
name: zen-${{ matrix.arch }}.AppImage.zsync
|
name: zen-${{ matrix.arch }}.AppImage.zsync
|
||||||
path: ./dist/zen-${{ matrix.arch }}.AppImage.zsync
|
path: ./dist/zen-${{ matrix.arch }}.AppImage.zsync
|
||||||
|
|
||||||
|
stop-self-hosted:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [windows-step-3, linux]
|
||||||
|
if: always()
|
||||||
|
steps:
|
||||||
|
- name: Stop self-hosted runner
|
||||||
|
if: ${{ inputs.create_release && inputs.update_branch == 'release' }}
|
||||||
|
run: |
|
||||||
|
echo "Stopping self-hosted runner"
|
||||||
|
echo "${{ secrets.SELF_HOSTED_RUNNER_STOP_SCRIPT }}" | base64 --decode > stop.sh
|
||||||
|
sudo chmod +x stop.sh
|
||||||
|
./stop.sh > /dev/null 2>&1 &
|
||||||
|
|
||||||
|
- name: Remove self-hosted runner script
|
||||||
|
if: always() && ${{ inputs.create_release && inputs.update_branch == 'release' }}
|
||||||
|
run: |
|
||||||
|
echo "Removing self-hosted runner script"
|
||||||
|
rm stop.sh
|
||||||
|
|
||||||
release:
|
release:
|
||||||
if: ${{ inputs.create_release || inputs.update_branch == 'twilight' }}
|
if: ${{ inputs.create_release || inputs.update_branch == 'twilight' }}
|
||||||
permissions: write-all
|
permissions: write-all
|
||||||
name: Release
|
name: Release
|
||||||
needs: [build-data, linux, windows-step-3, check-release, mac, appimage, source, lint]
|
needs: [build-data, linux, windows-step-3, check-release, mac, appimage, source, lint, stop-self-hosted]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment:
|
environment:
|
||||||
name: ${{ inputs.update_branch == 'release' && 'Deploy-Release' || 'Deploy-Twilight' }}
|
name: ${{ inputs.update_branch == 'release' && 'Deploy-Release' || 'Deploy-Twilight' }}
|
||||||
|
Reference in New Issue
Block a user