Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Sara Damiano <[email protected]>
  • Loading branch information
SRGDamia1 committed Aug 25, 2024
1 parent 5efaa1f commit 52d99b4
Show file tree
Hide file tree
Showing 7 changed files with 84 additions and 86 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build_examples.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build Examples

# Triggers the workflow on push or pull request events
on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_examples:
name: Build all examples with PlatformIO and the Arduino CLI
if: ${{ ! contains(github.event.head_commit.message, 'ci skip') }}
uses: EnviroDIY/workflows/.github/workflows/build_examples.yaml@main
with:
boards_to_build: 'all'
examples_to_build: 'examples/now, examples/temperature, examples/adjust, examples/PCsync'
secrets: inherit
38 changes: 0 additions & 38 deletions .github/workflows/build_examples_platformio.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/changelog_reminder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on: pull_request
name: Changelog Reminder
jobs:
remind:
name: Changelog Reminder
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token

- name: Changelog Reminder
uses: peterjgrainger/[email protected]
with:
changelog_regex: '/CHANGELOG\/.*\/*.md/i'
customPrMessage: 'Please add your changes to the change log!'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77 changes: 29 additions & 48 deletions .github/workflows/prepare_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,41 @@ on:
- 'VERSION' # Push events when the VERSION file changes
workflow_dispatch:

name: Prepare a new release and add release assets
name: Create a New Release

env:
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}

jobs:
release:
name: Prepare a new release
wait_for_checks:
if: ${{ github.event_name != 'workflow_dispatch' }}
strategy:
matrix:
req_workflow:
[
verify_library_structure.yaml,
build_examples.yaml,
]
name: Wait for Checks to complete
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set environment variable for current library version
run: |
echo "::debug::Get the current version number"
VER=$(cat VERSION)
ZIP_FILE="ModularSensors_Dependencies_${VER}"
echo "VERSION=$VER" >> $GITHUB_ENV
echo "ZIP_NAME=$ZIP_FILE" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Get notes
id: generate_notes
uses: anmarkoulis/commitizen-changelog-reader@master
with:
# NOTE: Need to add the refs/tags to work with the generate notes action
tag_name: ${{ format('refs/tags/{0}', env.VERSION) }}
changelog: ChangeLog.md

# Create a new release
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Wait on Workflow
uses: ArcticLampyrid/[email protected]
with:
tag_name: ${{ env.VERSION }}
release_name: ${{ env.VERSION }}
draft: false
prerelease: false
body: ${{join(fromJson(steps.generate_notes.outputs.notes).notes, '')}}
workflow: ${{ matrix.req_workflow }}
sha: ${{ github.sha || github.event.pull_request.head.sha || github.event.pull_request.head.ref }} # optional
allowed-conclusions: |
success
cancelled
skipped
# Publish the new release to the pio package manager
- name: Publish release to PIO
id: publish-pio
run: pio package publish
release:
name: Prepare a new release
needs: [wait_for_checks]
if: |
always() &&
(needs.wait_for_checks.result == 'success' || needs.wait_for_checks.result == 'skipped')
uses: EnviroDIY/workflows/.github/workflows/prepare_release.yaml@main
secrets: inherit
with:
include_dependencies: false
17 changes: 17 additions & 0 deletions .github/workflows/verify_library_structure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Verify library manifest and structure

# Triggers the workflow on push or pull request events
on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
verify_library_structure:
name: Validate library structure
if: ${{ ! contains(github.event.head_commit.message, 'ci skip') }}
uses: EnviroDIY/workflows/.github/workflows/verify_library_structure.yaml@main
with:
library-manager: 'update'
library-compliance: 'permissive'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@ examples/PCsync/PCsync.exe
*.tar.gz
examples/PCsync/python3.9/PCsync3.spec
examples/PCsync/python3.9/dist/PCsync3.exe
arduino_lint.json
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Changed to PC sync program to require the port number as input and to allow specifying the timezone.
- Update workflows

### Fixed

Expand Down

0 comments on commit 52d99b4

Please sign in to comment.