Skip to content

Commit

Permalink
Merge pull request #27 from particle-iot/feature/sc-125817/add-debug-…
Browse files Browse the repository at this point in the history
…logs-for-auto-version-feature

fix: [sc-125817] Fix auto-version crash for deleted files
  • Loading branch information
laupow authored Mar 7, 2024
2 parents 0b2fde4 + 0e2ba4d commit e165e04
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 30 deletions.
8 changes: 8 additions & 0 deletions AUTO_VERSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

The auto-versioning feature is designed to manage product firmware version numbers in an automated and consistent manner.

It is primarily intended for use in Action workflows that release firmware and upload it to Particle products.
Here is an [example firmware project](https://github.com/particle-iot/firmware-cicd-examples/tree/main/product-firmware) that has a two GitHub Actions workflows: build and upload.

## Usage

Auto-versioning is disabled by default. To enable auto-versioning:
Expand Down Expand Up @@ -188,3 +191,8 @@ jobs:
1. Manual Version Changes: If you manually increment the version macro while automatic versioning is enabled, the automatic versioning system may increment the version again.
It is recommended that you disable automatic versioning if you are going to manually increment the version macro.


## Debugging

To debug the auto-versioning feature, you can [re-run a job with debug logging](https://github.blog/changelog/2022-05-24-github-actions-re-run-jobs-with-debug-logging/) enabled.
This will allow you to see the step-by-step process of how the version number is determined and incremented.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Other Actions for firmware development: Compile | [Flash Device](https://github.
# Required: true
particle-platform-name: ''

# Path to directory with sources to compile
# This is your Particle project directory
# It contains your source code, libraries, and the project.properties file
# Required: false
sources-folder: '.'

Expand Down
108 changes: 97 additions & 11 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/autoversion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ jest.mock('fs/promises', () => ({

const warningMock = jest.fn();
const infoMock = jest.fn();
const debugMock = jest.fn();
const errorMock = jest.fn();
jest.mock('@actions/core', () => ({
warning: warningMock,
info: infoMock
info: infoMock,
debug: debugMock,
error: errorMock
}));

import { findProductVersionMacroFile, currentFirmwareVersion } from './git';
Expand Down
Loading

0 comments on commit e165e04

Please sign in to comment.