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

Add publish/release automation #2

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
1 change: 0 additions & 1 deletion .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
- name: Rebuild the dist/ directory
run: |
npm run build
npm run package

- name: Compare the expected and actual dist/ directories
run: |
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish

on:
release:
types: [published, edited]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.release.tag_name }}
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- run: npm run build
- uses: JasonEtco/build-and-tag-action@v2
env:
GITHUB_TOKEN: ${{ github.token }}
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- run: |
npm install
- run: |
Expand Down
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ nvm use
npm install
npm run all

env "INPUT_SOURCES-FOLDER=test/fixtures/single-file-firmware" env "INPUT_PARTICLE-PLATFORM-NAME=argon" node dist/index.js
env "INPUT_SOURCES-FOLDER=test/fixtures/single-file-firmware" env "INPUT_PARTICLE-PLATFORM-NAME=argon" npm start

# To Cloud Compile instead of local compile add the following env var to the string above
# To Cloud Compile instead of local compile add the following env var to the `npm start` cmd above
env "INPUT_PARTICLE-ACCESS-TOKEN=1234"
```
22 changes: 22 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Release

The release/publish process is [automated](.github/workflows/publish.yml) using GitHub Actions.

## Process

1. Merge all pull requests that are ready into the `main` branch
1. Create a new [GitHub Release](https://github.com/particle-iot/compile-action/releases/new)
1. Define the new tag following semantic versioning. _It must start with `v`, e.g. `v1.1.0`_. Prerelease tags are supported, e.g. `v1.1.0-rc.1`
2. Generate release notes
3. Check pre-release if appropriate
4. Click publish release

GitHub Actions will automatically package the compiled JS file.

It will force push `action.yml` and the compiled JS file to the release's tag.

The release process will keep major (`v1`) and minor (`v1.1`) tags current to the latest appropriate commit (this is skipped for pre-releases).

Note that it is possible to publish a prerelease from a branch. This is useful for testing the release process.

If you need to test functionality, you can use a `@main` or `@feature/new-capability` branch reference instead of a released tag.
Loading