Skip to content

Release BETA 4.0-b74 #74

Release BETA 4.0-b74

Release BETA 4.0-b74 #74

Workflow file for this run

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
environment:
name: github-pages
permissions:
contents: write
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Replace version in firmware source
run: |
sed -i 's/VERSION = ".*";/VERSION = "${{ env.BETA_VERSION }}";/' ${{ github.workspace }}/firmware/src/JaamFirmware.cpp
- 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 }}/firmware/.pio/build/firmware/firmware.bin ${{ github.workspace }}/bin_beta/${{ env.BETA_VERSION }}.bin
cp -f ${{ github.workspace }}/firmware/.pio/build/firmware/firmware.bin ${{ github.workspace }}/JAAM_${{ env.BETA_VERSION }}.bin
# Disabled for now
# - 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: Upload flasher to Github Pages
uses: ./.github/workflows/upload-pages
with:
beta_binary_path: ${{ github.workspace }}/JAAM_${{ env.BETA_VERSION }}.bin
version: ${{ inputs.release-version }}
beta_build: ${{ github.run_number }}
- 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/ ${{ github.workspace }}/flasher/
- name: Create Beta Pre Release
uses: ncipollo/release-action@v1
with:
artifacts: ${{ github.workspace }}/JAAM_${{ 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 }}
git pull
bash redeploy_update_server.sh -s '/root/ukraine_alarm_map/bin' -sb '/root/ukraine_alarm_map/bin_beta' -m ${{ secrets.MEMCACHED_HOST }}