mirror of
https://github.com/lora-aprs/LoRa_APRS_iGate.git
synced 2025-12-06 07:42:00 +01:00
update build action
This commit is contained in:
parent
065c97ada4
commit
bcbd174512
6
.github/workflows/build_check.yml
vendored
6
.github/workflows/build_check.yml
vendored
|
|
@ -1,6 +1,10 @@
|
||||||
name: Integreation Tests
|
name: Integreation Tests
|
||||||
|
|
||||||
on: [push, pull_request]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
- '!master'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
version_check:
|
version_check:
|
||||||
|
|
|
||||||
45
.github/workflows/release.yml
vendored
45
.github/workflows/release.yml
vendored
|
|
@ -1,46 +1,25 @@
|
||||||
|
name: Upload Release Assets
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
branches:
|
||||||
- 'v*'
|
- 'master'
|
||||||
|
|
||||||
name: Upload Release Assets
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: Upload Release Assets
|
name: Upload Release Assets
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
- run: sudo apt-get install python3-setuptools python3-wheel
|
- run: sudo apt-get install python3-setuptools python3-wheel
|
||||||
- run: pip3 install platformio
|
- run: pip3 install platformio
|
||||||
- run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
- run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
submodules: 'recursive'
|
|
||||||
- run: platformio run
|
- run: platformio run
|
||||||
- id: create_release
|
- run: echo "VERSION=$(echo ./scripts/create_version_tag.py)" >> $GITHUB_ENV
|
||||||
uses: actions/create-release@v1
|
- uses: ncipollo/release-action@v1
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ github.ref }}
|
tag: ${{ env.VERSION }}
|
||||||
release_name: Release ${{ github.ref }}
|
commit: Release ${{ env.VERSION }}
|
||||||
draft: false
|
generateReleaseNotes: true
|
||||||
prerelease: false
|
artifacts: ".pio/build/lora_board/firmware.bin,data/is-cfg.json"
|
||||||
# upload firmware bin
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: .pio/build/lora_board/firmware.bin
|
|
||||||
asset_name: lora_board.bin
|
|
||||||
asset_content_type: application/bin
|
|
||||||
# upload json file
|
|
||||||
- uses: actions/upload-release-asset@v1
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
asset_path: data/is-cfg.json
|
|
||||||
asset_name: is-cfg.json
|
|
||||||
asset_content_type: application/json
|
|
||||||
|
|
|
||||||
21
scripts/create_version_tag.py
Executable file
21
scripts/create_version_tag.py
Executable file
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
from datetime import date
|
||||||
|
|
||||||
|
today = date.today()
|
||||||
|
|
||||||
|
current_year = int(str(today.isocalendar()[0])[2:])
|
||||||
|
current_week = int(today.isocalendar()[1])
|
||||||
|
|
||||||
|
version = None
|
||||||
|
with open("src/LoRa_APRS_iGate.cpp") as f:
|
||||||
|
for line in f:
|
||||||
|
if line.startswith("#define VERSION"):
|
||||||
|
version = line.strip().split(" ")[-1].replace('"', "")
|
||||||
|
|
||||||
|
version_split = version.split(".")
|
||||||
|
version_year = int(version_split[0])
|
||||||
|
version_week = int(version_split[1])
|
||||||
|
version_vers = int(version_split[2])
|
||||||
|
|
||||||
|
print(f"v{version_year}.{version_week}.{version_vers}")
|
||||||
Loading…
Reference in a new issue