Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [sc-125817] Fix auto-version crash for deleted files #27

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading