-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from v00g100skr/beta_build_support
Додано підтримку beta прошивок
- Loading branch information
Showing
7 changed files
with
259 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: 🅱️ Release BETA Firmware | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release-version: | ||
description: 'Beta version, ex. 3.6 or 3.6.1' | ||
required: true | ||
type: string | ||
run-name: Release BETA ${{ inputs.release-version }}-b${{ github.run_number }} | ||
env: | ||
BETA_VERSION: ${{ inputs.release-version }}-b${{ github.run_number }} | ||
RELEASE_TITLE: Beta ${{ inputs.release-version }}-b${{ github.run_number }} | ||
jobs: | ||
release_beta_firmware: | ||
if: ${{ github.ref_name == 'develop' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Replace version in firmware source | ||
run: | | ||
sed -i "s/String VERSION = \".*\";/String VERSION = \"${{ env.BETA_VERSION }}\";/" ${{ github.workspace }}/src/firmware/firmware.ino | ||
- name: Compile firmware | ||
uses: ./.github/workflows/firmware-compile | ||
- name: Copy release files to bin folder | ||
run: | | ||
mkdir -p ${{ github.workspace }}/bin_beta/ | ||
cp -f ${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.bin ${{ github.workspace }}/bin_beta/${{ env.BETA_VERSION }}.bin | ||
cp -f ${{ github.workspace }}/src/firmware/build/esp32.esp32.esp32/firmware.ino.bin ${{ github.workspace }}/bin_beta/latest_beta.bin | ||
- name: Leave only 3 recent BETA builds | ||
run: | | ||
cd ${{ github.workspace }}/bin_beta/ | ||
ls -tp | grep -v '/$' | tail -n +5 | xargs -I {} rm -- {} | ||
cd ${{ github.workspace }} | ||
- name: Commit changes | ||
id: commit_changes | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: "Beta ${{ env.BETA_VERSION }}" | ||
file_pattern: ${{ github.workspace }}/bin_beta/ | ||
- name: Create Beta Pre Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: ${{ github.workspace }}/bin_beta/${{ env.BETA_VERSION }}.bin | ||
name: ${{ env.RELEASE_TITLE }} | ||
commit: ${{ steps.commit_changes.outputs.commit_hash }} | ||
tag: ${{ env.BETA_VERSION }} | ||
generateReleaseNotes: true | ||
allowUpdates: true | ||
prerelease: true | ||
makeLatest: false | ||
- name: Update server test bin list | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SERVER_IP }} | ||
username: ${{ secrets.SERVER_SSH_USER }} | ||
password: ${{ secrets.SERVER_SSH_PASSWORD }} | ||
script: | | ||
cd /root/ukraine_alarm_map/deploy/ | ||
git fetch --all | ||
git checkout ${{ github.ref_name }} | ||
bash redeploy_update_server.sh -s '/root/ukraine_alarm_map/bin' -sb '/root/ukraine_alarm_map/bin_beta' -m ${{ secrets.MEMCACHED_HOST }} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ jobs: | |
cd /root/ukraine_alarm_map/deploy/ | ||
git fetch --all | ||
git checkout ${{ github.ref_name }} | ||
bash redeploy_update_server.sh -s '/root/ukraine_alarm_map/bin' -m ${{ secrets.MEMCACHED_HOST }} | ||
bash redeploy_update_server.sh -s '/root/ukraine_alarm_map/bin' -sb '/root/ukraine_alarm_map/bin_beta' -m ${{ secrets.MEMCACHED_HOST }} | ||
- name: Redeploy Web Server | ||
if: ${{ inputs.redeploy_web_server || inputs.redeploy_all }} | ||
uses: appleboy/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.