Skip to content

Commit

Permalink
Merge pull request #4 from xyzroe/main
Browse files Browse the repository at this point in the history
Rework workflow
  • Loading branch information
xyzroe authored Aug 29, 2023
2 parents 1637a01 + a0c597b commit f22d911
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 86 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/build.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/update_manifest.yml

This file was deleted.

86 changes: 86 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Build, release, update

permissions:
contents: write

on:
workflow_dispatch:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build_firmware:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v3

- name: Install Node JS
uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install PlatformIO Core
run: pip install --upgrade platformio

- name: Build PlatformIO Project
run: pio run
- name: Get Release Version
id: get_version
shell: bash
run: |
value=`cat tools/version`
echo "version=$value" >> $GITHUB_OUTPUT
- name: Get current date
id: date
run: echo "date=$(date +'%d%m%y')" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
name: "v${{ steps.get_version.outputs.version }} (${{ steps.date.outputs.date }})"
files: |
bin/UZG-01.bin
bin/UZG-01_v${{ steps.get_version.outputs.version }}.full.bin
update_manifest:
needs: build_firmware
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Get Release Version
id: get_version
shell: bash
run: |
value=`cat tools/version`
echo "version=$value" >> $GITHUB_OUTPUT
- name: Updare version in manifest.json
run: |
sed -r 's/v[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4}/v${{ steps.get_version.outputs.version }}/g' manifest.json > new.manifest.json
- name: Move file
shell: bash
run: |
echo "old"
cat manifest.json
mv -f new.manifest.json manifest.json
echo "new"
cat manifest.json
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
message: 'update manifest.json'
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"chipFamily": "ESP32",
"improv": false,
"parts": [
{ "path": "https://github.com/mercenaruss/uzg-firmware/releases/download/v0.1.1/UZG-01_v0.1.1.full.bin", "offset": 0 }
{ "path": "https://github.com/mercenaruss/uzg-firmware/releases/download/v0.1.4/UZG-01_v0.1.4.full.bin", "offset": 0 }
]
}
]
Expand Down
4 changes: 2 additions & 2 deletions src/version.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

// AUTO GENERATED FILE, DO NOT EDIT
#ifndef VERSION
#define VERSION "0.1.3"
#define VERSION "0.1.4"
#endif
#ifndef BUILD_TIMESTAMP
#define BUILD_TIMESTAMP "2023-08-21 20:16:30.632450"
#define BUILD_TIMESTAMP "2023-08-22 01:30:16.538290"
#endif

2 changes: 1 addition & 1 deletion tools/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.3
0.1.4

0 comments on commit f22d911

Please sign in to comment.