2023-06-15 00:15:44 +00:00
|
|
|
name: Build Pipeline
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
jobs:
|
|
|
|
FLHook:
|
|
|
|
runs-on: windows-latest
|
2023-06-15 14:46:01 +00:00
|
|
|
if: ${{ !contains(github.event.head_commit.message, 'Update FLHook') }}
|
2023-06-15 00:15:44 +00:00
|
|
|
steps:
|
|
|
|
- name: Get last FLHook tag
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
sparse-checkout: .github/workflows/flhooktag
|
|
|
|
sparse-checkout-cone-mode: false
|
|
|
|
path: check
|
|
|
|
|
|
|
|
- name: Download latest FLHook release
|
|
|
|
id: download-release
|
|
|
|
uses: robinraju/release-downloader@v1.8
|
|
|
|
with:
|
|
|
|
repository: "TheStarport/FLHook"
|
|
|
|
fileName: "Release.zip"
|
|
|
|
latest: true
|
|
|
|
extract: true
|
|
|
|
|
|
|
|
- name: Is there a new release?
|
|
|
|
env:
|
|
|
|
TAG: ${{steps.download-release.outputs.tag_name}}
|
|
|
|
run: if( (Get-Content -Path .\check\.github\workflows\flhooktag) -ne $env:TAG ) { echo "NEW=true" >> $env:GITHUB_ENV }
|
|
|
|
|
|
|
|
- name: Checkout full repo
|
|
|
|
if: env.NEW == 'true'
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
path: staging
|
|
|
|
token: ${{ secrets.PAT }}
|
|
|
|
sparse-checkout: |
|
|
|
|
.github/workflows/flhooktag
|
|
|
|
EXE
|
|
|
|
sparse-checkout-cone-mode: false
|
|
|
|
|
|
|
|
- name: Copy new release
|
|
|
|
if: env.NEW == 'true'
|
|
|
|
run: copy Release/*.* EXE
|
|
|
|
|
|
|
|
- name: Commit to branch
|
|
|
|
if: env.NEW == 'true'
|
|
|
|
env:
|
|
|
|
TAG: ${{steps.download-release.outputs.tag_name}}
|
|
|
|
run: |
|
|
|
|
cd staging
|
|
|
|
echo $env:TAG > .github/workflows/flhooktag
|
|
|
|
git config user.name github-actions
|
|
|
|
git config user.email github-actions@github.com
|
|
|
|
git add EXE
|
|
|
|
git add .github/workflows/flhooktag
|
2023-06-15 14:46:01 +00:00
|
|
|
git commit -m "Update FLHook to $env:TAG"
|
2023-06-15 00:15:44 +00:00
|
|
|
git push
|