mirror of
https://github.com/Detanup01/gbe_fork.git
synced 2024-12-26 02:14:15 +08:00
don't cache deps build when pushing tag or opening pull requests
This commit is contained in:
parent
62afce33ca
commit
0a50c37584
46
.github/workflows/build-linux.yml
vendored
46
.github/workflows/build-linux.yml
vendored
@ -25,23 +25,28 @@ env:
|
|||||||
PACKAGE_ROOT_PATH: "build-linux/package"
|
PACKAGE_ROOT_PATH: "build-linux/package"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
dependencies:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout branch
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
### deps
|
||||||
- name: Lookup cache for deps
|
- name: Lookup cache for deps
|
||||||
id: emu-deps-cache-step
|
id: emu-deps-cache-step
|
||||||
|
# !tag && !pull_request
|
||||||
|
# also you could use this: github.event_name != 'pull_request'
|
||||||
|
if: |
|
||||||
|
!startsWith(github.ref, 'refs/tags/') &&
|
||||||
|
!startsWith(github.ref, 'refs/pull/')
|
||||||
|
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
key: ${{ env.DEPS_CACHE_KEY }}
|
key: ${{ env.DEPS_CACHE_KEY }}
|
||||||
path: ${{ env.DEPS_CACHE_DIR }}
|
path: ${{ env.DEPS_CACHE_DIR }}
|
||||||
lookup-only: true
|
lookup-only: true
|
||||||
|
|
||||||
# we need the repo to build the deps since it has the build scripts
|
|
||||||
- name: Checkout branch
|
|
||||||
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Clone third-party deps (deps/linux)
|
- name: Clone third-party deps (deps/linux)
|
||||||
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -61,47 +66,33 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: sudo chmod 777 build_linux_deps.sh && sudo ./build_linux_deps.sh
|
run: sudo chmod 777 build_linux_deps.sh && sudo ./build_linux_deps.sh
|
||||||
|
|
||||||
|
## mandatory Linux packages, installed via sudo apt install ...
|
||||||
build:
|
|
||||||
needs: [ dependencies ]
|
|
||||||
runs-on: ubuntu-22.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout branch
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
### deps
|
|
||||||
- name: Grab cache for deps
|
|
||||||
id: emu-deps-cache-step
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
key: ${{ env.DEPS_CACHE_KEY }}
|
|
||||||
path: ${{ env.DEPS_CACHE_DIR }}
|
|
||||||
fail-on-cache-miss: true
|
|
||||||
|
|
||||||
- name: Install required packages
|
- name: Install required packages
|
||||||
shell: bash
|
shell: bash
|
||||||
run: sudo chmod 777 build_linux_deps.sh && sudo ./build_linux_deps.sh -packages_only
|
run: sudo chmod 777 build_linux_deps.sh && sudo ./build_linux_deps.sh -packages_only
|
||||||
|
|
||||||
|
## extra helpers/tools, these are not built inside the deps build dir
|
||||||
- name: Clone third-party build helpers (build/linux)
|
- name: Clone third-party build helpers (build/linux)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: 'third-party/build/linux'
|
ref: 'third-party/build/linux'
|
||||||
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/linux"
|
path: "${{env.THIRD_PARTY_BASE_DIR}}/build/linux"
|
||||||
|
|
||||||
### build + upload release
|
### build (release mode)
|
||||||
- name: Build release mode
|
- name: Build release mode
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: "sudo chmod 777 build_linux.sh && ./build_linux.sh release"
|
run: "sudo chmod 777 build_linux.sh && ./build_linux.sh release"
|
||||||
|
|
||||||
|
### package (release mode)
|
||||||
- name: Package build (release)
|
- name: Package build (release)
|
||||||
if: success()
|
if: success()
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: sudo chmod 77 package_linux.sh && sudo ./package_linux.sh release
|
run: sudo chmod 77 package_linux.sh && sudo ./package_linux.sh release
|
||||||
|
|
||||||
|
### upload artifact/package to github Actions (release mode)
|
||||||
- name: Upload build pacakge (release)
|
- name: Upload build pacakge (release)
|
||||||
if: success()
|
if: success()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -112,19 +103,21 @@ jobs:
|
|||||||
compression-level: 9
|
compression-level: 9
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
### build + upload debug
|
### build (debug mode)
|
||||||
- name: Build debug mode
|
- name: Build debug mode
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: "sudo chmod 777 build_linux.sh && ./build_linux.sh debug"
|
run: "sudo chmod 777 build_linux.sh && ./build_linux.sh debug"
|
||||||
|
|
||||||
|
### package (debug mode)
|
||||||
- name: Package build (debug)
|
- name: Package build (debug)
|
||||||
if: success()
|
if: success()
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: sudo chmod 77 package_linux.sh && sudo ./package_linux.sh debug
|
run: sudo chmod 77 package_linux.sh && sudo ./package_linux.sh debug
|
||||||
|
|
||||||
|
### upload artifact/package to github Actions (debug mode)
|
||||||
- name: Upload build pacakge (debug)
|
- name: Upload build pacakge (debug)
|
||||||
if: success()
|
if: success()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -135,6 +128,7 @@ jobs:
|
|||||||
compression-level: 9
|
compression-level: 9
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
### release (debug + release modes) if this is a tag push
|
||||||
- name: Release
|
- name: Release
|
||||||
if: success() && startsWith(github.ref, 'refs/tags/')
|
if: success() && startsWith(github.ref, 'refs/tags/')
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
45
.github/workflows/build-win.yml
vendored
45
.github/workflows/build-win.yml
vendored
@ -24,22 +24,25 @@ env:
|
|||||||
PACKAGE_ROOT_PATH: "build-win/package"
|
PACKAGE_ROOT_PATH: "build-win/package"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
dependencies:
|
build:
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout branch
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
### deps
|
||||||
- name: Lookup cache for deps
|
- name: Lookup cache for deps
|
||||||
id: emu-deps-cache-step
|
id: emu-deps-cache-step
|
||||||
|
# !tag && !pull_request
|
||||||
|
# also you could use this: github.event_name != 'pull_request'
|
||||||
|
if: |
|
||||||
|
!startsWith(github.ref, 'refs/tags/') &&
|
||||||
|
!startsWith(github.ref, 'refs/pull/')
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
key: ${{ env.DEPS_CACHE_KEY }}
|
key: ${{ env.DEPS_CACHE_KEY }}
|
||||||
path: ${{ env.DEPS_CACHE_DIR }}
|
path: ${{ env.DEPS_CACHE_DIR }}
|
||||||
lookup-only: true
|
|
||||||
|
|
||||||
# we need the repo to build the deps since it has the build scripts
|
|
||||||
- name: Checkout branch
|
|
||||||
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Clone third-party deps (deps/win)
|
- name: Clone third-party deps (deps/win)
|
||||||
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
||||||
@ -68,24 +71,7 @@ jobs:
|
|||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: build_win_deps.bat
|
run: build_win_deps.bat
|
||||||
|
|
||||||
|
## extra helpers/tools, these are not built inside the deps build dir
|
||||||
build:
|
|
||||||
needs: [ dependencies ]
|
|
||||||
runs-on: windows-2022
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout branch
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
### deps
|
|
||||||
- name: Grab cache for deps
|
|
||||||
id: emu-deps-cache-step
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
key: ${{ env.DEPS_CACHE_KEY }}
|
|
||||||
path: ${{ env.DEPS_CACHE_DIR }}
|
|
||||||
fail-on-cache-miss: true
|
|
||||||
|
|
||||||
- name: Clone third-party build helpers (common/win)
|
- name: Clone third-party build helpers (common/win)
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -98,19 +84,21 @@ jobs:
|
|||||||
ref: 'third-party/deps/win'
|
ref: 'third-party/deps/win'
|
||||||
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"
|
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"
|
||||||
|
|
||||||
### build + upload release
|
### build (release mode)
|
||||||
- name: Build release mode
|
- name: Build release mode
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
shell: cmd
|
shell: cmd
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: build_win.bat release
|
run: build_win.bat release
|
||||||
|
|
||||||
|
### package (release mode)
|
||||||
- name: Package build (release)
|
- name: Package build (release)
|
||||||
if: success()
|
if: success()
|
||||||
shell: cmd
|
shell: cmd
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: package_win.bat release
|
run: package_win.bat release
|
||||||
|
|
||||||
|
### upload artifact/package to github Actions (release mode)
|
||||||
- name: Upload build pacakge (release)
|
- name: Upload build pacakge (release)
|
||||||
if: success()
|
if: success()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -121,19 +109,21 @@ jobs:
|
|||||||
compression-level: 9
|
compression-level: 9
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
### build + upload debug
|
### build (debug mode)
|
||||||
- name: Build debug mode
|
- name: Build debug mode
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
shell: cmd
|
shell: cmd
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: build_win.bat debug
|
run: build_win.bat debug
|
||||||
|
|
||||||
|
### package (debug mode)
|
||||||
- name: Package build (debug)
|
- name: Package build (debug)
|
||||||
if: success()
|
if: success()
|
||||||
shell: cmd
|
shell: cmd
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
run: package_win.bat debug
|
run: package_win.bat debug
|
||||||
|
|
||||||
|
### upload artifact/package to github Actions (debug mode)
|
||||||
- name: Upload build pacakge (debug)
|
- name: Upload build pacakge (debug)
|
||||||
if: success()
|
if: success()
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -144,6 +134,7 @@ jobs:
|
|||||||
compression-level: 9
|
compression-level: 9
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
### release (debug + release modes) if this is a tag push
|
||||||
- name: Release
|
- name: Release
|
||||||
if: success() && startsWith(github.ref, 'refs/tags/')
|
if: success() && startsWith(github.ref, 'refs/tags/')
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user