Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
KipK committed Mar 29, 2023
2 parents 031f14e + 8e17e58 commit 74abe06
Show file tree
Hide file tree
Showing 9 changed files with 192 additions and 103 deletions.
48 changes: 34 additions & 14 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

name: Build/Release OpenEVSE

permissions:
contents: write

on:
workflow_dispatch:
inputs:
Expand All @@ -13,10 +16,12 @@ on:
required: true
description: The branch/tag for the v2 UI
default: master

push:
branches:
- master
tags:
- 'v*'
pull_request:

jobs:
Expand All @@ -28,7 +33,7 @@ jobs:

- name: Dump the event
run: cat $GITHUB_EVENT_PATH

- name: Dump github.ref_name
run: echo "github.ref_name = '${{ github.ref_name }}'"

Expand All @@ -54,11 +59,11 @@ jobs:
- openevse_esp32-poe-iso
- openevse_esp32-heltec-wifi-lora-v2
gui:
- name: dev_gui-v1
- name: gui-v1
repo: OpenEVSE/openevse_wifi_gui
build_flags: ""
ref: ${{ inputs.v1_ref }}
- name: dev_gui-v2
- name: gui-v2
repo: KipK/openevse-gui-v2
build_flags: "-D DISABLE_WIFI_PORTAL -D WEB_SERVER_ROOT_PAGE_INDEX"
ref: ${{ inputs.v2_ref }}
Expand All @@ -68,13 +73,6 @@ jobs:

- uses: actions/checkout@v3

# - name: Temp checkout latest OpenEVSE lib
# uses: actions/checkout@v3
# with:
# repository: jeremypoulter/OpenEVSE_Lib
# ref: openevse_wifi_timer_apis
# path: lib/OpenEVSE

- name: Checkout GUI
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -137,7 +135,7 @@ jobs:
release:
runs-on: ubuntu-latest
needs: build
if: github.ref_name == 'master' || github.ref_name == 'build_v2_gui' || github.head_ref == 'build_v2_gui'
if: github.ref_name == 'master' || startsWith(github.ref_name, 'v')

steps:
- name: Download the built assets
Expand All @@ -155,11 +153,33 @@ jobs:
done
- name: Upload assets to latest release
if: github.ref_name == 'master'
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ github.ref_name == 'master' && 'latest' || 'v2_gui' }}"
automatic_release_tag: latest
prerelease: true
title: Development Build
files: |
*gui-v1.bin
- name: Upload assets to the v2 GUI release
if: github.ref_name == 'master'
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: v2_gui
prerelease: true
title: V2 GUI pre-release
files: |
*gui-v2.bin
- name: Upload assets to release
if: startsWith(github.ref_name, 'v')
uses: "softprops/action-gh-release@v1"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
title: "${{ github.ref_name == 'master' && 'Development Build' || 'V2 GUI pre-release' }}"
title: "${{ github.ref_name }}"
files: |
*.bin
10 changes: 5 additions & 5 deletions .github/workflows/release_validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Node JS
uses: actions/setup-node@v3
with:
node-version: '12'
node-version: '16'

- name: Install dependencies
run: |
Expand Down Expand Up @@ -53,14 +53,14 @@ jobs:

- name: Retrieve the version number(s)
run: |
TAG_VERSION=$(sed "s/^v//" <<< $GITHUB_REF_NAME)
CODE_VERSION=$(grep BUILD_TAG platformio.ini | awk -F= '{print $NF}')
TAG_VERSION=$GITHUB_REF_NAME
CODE_VERSION=$(git describe --tags)
echo TAG_VERSION=$TAG_VERSION >> $GITHUB_ENV
echo CODE_VERSION=$CODE_VERSION >> $GITHUB_ENV
- name: Check the version numberis semver compliant
- name: Check the version number is semver compliant
run: |
if ! [[ $TAG_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-z]*[0-9]+)?$ ]]; then
if ! [[ $TAG_VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-z]*[0-9]+)?$ ]]; then
echo "ERROR: The version number is not semver compliant"
exit 1
fi
Expand Down
181 changes: 125 additions & 56 deletions api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ info:
contact:
email: [email protected]
name: Jeremy Poulter
url: https://github.com/jeremypoulter/
url: 'https://github.com/jeremypoulter/'
license:
name: Apache 2.0
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
Expand Down Expand Up @@ -531,7 +531,7 @@ paths:
/limit:
get:
summary: Get charge limit
description: This will return the limit type, value and auto_release (true|false) defined if there's one
description: 'This will return the limit type, value and auto_release (true|false) defined if there''s one'
responses:
'200':
description: Limit properties
Expand All @@ -554,7 +554,7 @@ paths:
- Limit
post:
summary: Set charge limit
description: This will set the limit type, value and auto_release (true|false)
description: 'This will set the limit type, value and auto_release (true|false)'
responses:
'200':
description: Limit set
Expand All @@ -567,15 +567,15 @@ paths:
type: string
description: created
'500':
description: Failed to parse data
content:
application/json:
schema:
type: object
properties:
msg:
type: string
description: Failed to parse JSON
description: Failed to parse data
content:
application/json:
schema:
type: object
properties:
msg:
type: string
description: Failed to parse JSON
requestBody:
content:
application/json:
Expand All @@ -585,42 +585,42 @@ paths:
tags:
- Limit
delete:
summary: Get charge limit
description: This will clear current limit
responses:
'200':
description: Clear Limit ok
content:
application/json:
schema:
type: object
properties:
msg:
type: string
description: Deleted
'404':
description: No limit
content:
application/json:
schema:
type: object
properties:
msg:
type: string
description: No limit to clear
'500':
description: Failed to clear limit
content:
application/json:
schema:
type: object
properties:
msg:
type: string
description: Failed to clear limit
operationId: limit_clear
tags:
- Limit
summary: Get charge limit
description: This will clear current limit
responses:
'200':
description: Clear Limit ok
content:
application/json:
schema:
type: object
properties:
msg:
type: string
description: Deleted
'404':
description: No limit
content:
application/json:
schema:
type: object
properties:
msg:
type: string
description: No limit to clear
'500':
description: Failed to clear limit
content:
application/json:
schema:
type: object
properties:
msg:
type: string
description: Failed to clear limit
operationId: limit_clear
tags:
- Limit
/emeter:
delete:
summary: Reset Energy Meter
Expand All @@ -641,13 +641,13 @@ paths:
'200':
description: Reset counter ok
content:
application/json:
schema:
type: object
properties:
msg:
type: string
description: Reset done
application/json:
schema:
type: object
properties:
msg:
type: string
description: Reset done
'500':
description: Failed to reset counter
content:
Expand All @@ -661,7 +661,6 @@ paths:
operationId: energymeter-reset
tags:
- Energy Meter

/tesla/vehicles:
get:
summary: Get Tesla vehicle list
Expand Down Expand Up @@ -716,6 +715,75 @@ paths:
name: My Tesla
operationId: get-tesla-vehicles
description: Once the Tesla account credentials have been configured via the `/config` API this endpoint will return a list of vehicles associated with the account. The ID of the vehicle to use for SoC/Range can then be set using `tesla_vehicle_id` on the `/config` endpoint.
/time:
get:
summary: Get the time
tags:
- Time
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
time:
type: string
x-stoplight:
id: 6q0laeyxt5u85
description: The time in UTC according to the OpenEVSE.
format: date-time
offset:
type: string
x-stoplight:
id: u5zngl88caktf
pattern: '^[+-][0-9]{4}$'
local_time:
type: string
x-stoplight:
id: 7h1cpgfjj5j9j
format: date-time
required:
- time
- offset
- local_time
operationId: get-time
description: Gets the time set on the OpenEVSE
post:
summary: Set the time
tags:
- Time
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
x-examples:
Example 1:
sntp_enabled: false
time_zone: 'GMT0BST,M3.5.0/1,M10.5.0'
time: '2018-08-10T14:30:00Z'
properties:
sntp_enabled:
type: boolean
description: |
Set to `true` to enable receiving time updates via NTP, `false` will disable NTP updates.
default: false
time_zone:
type: string
description: The time zone to use on the OpenEVSE. This has the format `<location name>|<POSIX timezone>`. The `location name` is not used by the EVSE and is largely to for the UI to provide a human readable version of the timezone and differentiate between locations that use the same time zone.
default: UTC0
time:
type: string
description: If `sntp_enabled` is false this is the time to set. Must be in UTC.
format: date-time
'400':
$ref: '#/components/responses/BadRequest'
operationId: post-time
description: Set the time and associated config options. If not setting the time the `/config` endpoint can be used.
components:
schemas:
Message:
Expand Down Expand Up @@ -860,3 +928,4 @@ tags:
- name: Tesla
- name: Limit
- name: Energy Meter
- name: Time
11 changes: 5 additions & 6 deletions docs/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@ For releases and PR approval the builds are built using the [Build/Release OpenE

1. Ensure GitHub actions are complete and green
[![Build/Release OpenEVSE](https://github.com/OpenEVSE/ESP32_WiFi_V4.x/actions/workflows/build.yaml/badge.svg)](https://github.com/OpenEVSE/ESP32_WiFi_V4.x/actions/workflows/build.yaml)
1. Check the [version number](https://semver.org/) is correct
1. Go to the latest [Development Build](https://github.com/OpenEVSE/ESP32_WiFi_V4.x/releases/tag/latest) release
1. Edit the release
1. Change the tag from latest to the [version number](https://semver.org/), for example: `v1.0.0`
1. Change the branch to `latest`, is not automatically filled in so have to type the name in. Will show the appropriate commit hash on pressing enter
1. Enter the version number as the release name, for example: `v1.0.0`
1. Create a new [GitHub release](https://github.com/OpenEVSE/ESP32_WiFi_V4.x/releases/new) entering the tag name as the new [version number](https://semver.org/), for example: `v1.0.0`
1. Add the release notes, a good start is to use the `Auto-Generated Release Notes` and edit as needed
1. Select the `Pre-release` checkbox
1. Click `Publish release`
1. The GitHub build workflow will generate the binaries and upload them to the release
1. Remove any unwanted binaries, need at least:
- `openevse_esp32-gateway-e.bin`
- `openevse_huzzah32.bin`
- `openevse_wifi_v1.bin`
- `openevse_esp-wrover-kit`
- `openevse_nodemcu-32s`
1. Test the uploaded binaries
1. Unselect the `Pre-release` checkbox
1. Click `Update release`
1. Ensure the release validation action is green
Expand Down
Loading

0 comments on commit 74abe06

Please sign in to comment.