mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
ci: Run CI on dev/ branches but don't create nightly
This commit is contained in:
parent
067621cd51
commit
5f1ab7b8b2
1 changed files with 13 additions and 7 deletions
20
.github/workflows/build_push.yml
vendored
20
.github/workflows/build_push.yml
vendored
|
@ -3,6 +3,7 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- dev/**
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
|
@ -41,6 +42,11 @@ jobs:
|
||||||
mkdir -p ~/.gradle
|
mkdir -p ~/.gradle
|
||||||
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
||||||
|
|
||||||
|
- name: Extract branch name
|
||||||
|
id: branch_name
|
||||||
|
shell: bash
|
||||||
|
run: echo "name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
# PROD
|
# PROD
|
||||||
- name: Prepare release build
|
- name: Prepare release build
|
||||||
if: github.event.inputs.version != ''
|
if: github.event.inputs.version != ''
|
||||||
|
@ -50,7 +56,7 @@ jobs:
|
||||||
|
|
||||||
# NIGHTLY
|
# NIGHTLY
|
||||||
- name: Prepare nightly build
|
- name: Prepare nightly build
|
||||||
if: github.event.inputs.version == ''
|
if: steps.branch_name.outputs.name == 'master'
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
echo "VERSION_TAG=r$(git rev-list --count HEAD)" >> $GITHUB_ENV
|
echo "VERSION_TAG=r$(git rev-list --count HEAD)" >> $GITHUB_ENV
|
||||||
|
@ -137,12 +143,6 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Delete Old Nightly
|
|
||||||
if: startsWith(env.VERSION_TAG, 'r') && env.PREV_TAG != ''
|
|
||||||
run: gh release delete ${{ env.PREV_TAG }} --cleanup-tag
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Create Nightly
|
- name: Create Nightly
|
||||||
if: startsWith(env.VERSION_TAG, 'r')
|
if: startsWith(env.VERSION_TAG, 'r')
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
@ -173,5 +173,11 @@ jobs:
|
||||||
yokai-x86_64-${{ env.VERSION_TAG }}.apk
|
yokai-x86_64-${{ env.VERSION_TAG }}.apk
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: true
|
prerelease: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Delete Old Nightly
|
||||||
|
if: startsWith(env.VERSION_TAG, 'r') && env.PREV_TAG != ''
|
||||||
|
run: gh release delete ${{ env.PREV_TAG }} --cleanup-tag
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
Loading…
Add table
Add a link
Reference in a new issue