Add binaries to binary branch instead of master (#441)
This commit is contained in:
41
.github/workflows/release.yml
vendored
41
.github/workflows/release.yml
vendored
@@ -97,10 +97,24 @@ jobs:
|
||||
- name: Git Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.head_ref }}
|
||||
ref: binary
|
||||
- name: Git Checkout master
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: master
|
||||
path: master
|
||||
sparse-checkout: |
|
||||
resources/ota_manifest.py
|
||||
src/Config.h
|
||||
- name: Git Commands
|
||||
run: |
|
||||
git checkout --orphan newBinary
|
||||
git branch -D binary
|
||||
git branch -M binary
|
||||
git rm --cached --ignore-unmatch -r *
|
||||
- name: Get the version
|
||||
id: get_version
|
||||
run: echo "VERSION=$(cat src/Config.h | grep -oP '(?<=#define NUKI_HUB_VERSION \")(.*)(?=\")')" >> $GITHUB_OUTPUT
|
||||
run: echo "VERSION=$(cat master/src/Config.h | grep -oP '(?<=#define NUKI_HUB_VERSION \")(.*)(?=\")')" >> $GITHUB_OUTPUT
|
||||
- name: Download release assets
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
@@ -167,22 +181,27 @@ jobs:
|
||||
env:
|
||||
Version: ${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}
|
||||
run: |
|
||||
mkdir -p ota/
|
||||
mkdir -p resources/
|
||||
mkdir -p src/
|
||||
cp -vf release/*/nuki_hub_*.bin ota/
|
||||
cp -vf release/*/webflash_nuki_hub_*.bin webflash/
|
||||
rm -rf release
|
||||
rm -rf debug
|
||||
rm -rf NukiHub-*.zip
|
||||
git rm -r --cached ota/beta/*.bin
|
||||
cp -vf master/resources/ota_manifest.py resources/ota_manifest.py
|
||||
cp -vf master/src/Config.h src/Config.h
|
||||
python3 resources/ota_manifest.py release $Version
|
||||
python3 resources/ota_manifest.py beta none
|
||||
- name: Commit binaries to master
|
||||
find * -not -path "ota*" -not -path "webflash*" -delete
|
||||
rm -rf ota/beta/*.bin
|
||||
rm -rf .github .gitignore .gitmodules
|
||||
- name: Commit binaries to binary
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
commit_message: "Update binaries for version ${{ steps.get_version.outputs.VERSION }}"
|
||||
file_pattern: 'ota/*.bin ota/manifest.json ota/beta/*.bin webflash/*.bin'
|
||||
branch: master
|
||||
commit_message: "Update binaries"
|
||||
file_pattern: 'ota/* ota/master/* webflash/*'
|
||||
branch: binary
|
||||
skip_dirty_check: true
|
||||
skip_fetch: true
|
||||
skip_checkout: true
|
||||
disable_globbing: true
|
||||
add_options: '-f'
|
||||
add_options: '-f'
|
||||
push_options: '-f'
|
||||
|
||||
Reference in New Issue
Block a user