-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR makes the following changes: - Update `build-and-publish-asset.yml` workflow to run on all merges to master. The workflow it triggers will now create a release, build and publish if the asset version has been bumped. - Add test to ensure versions in `asset/asset.json`, `asset/package.json`, and `package.json` stay synced.
- Loading branch information
Showing
4 changed files
with
71 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
name: Build and Publish Teraslice Asset | ||
run-name: ${{ github.actor }} is building and publishing the Teraslice Asset | ||
name: Build, Publish and Release Teraslice Asset | ||
run-name: ${{ github.actor }} is building, publishing and releasing the Teraslice Asset | ||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
pull_request: | ||
branches: | ||
- master | ||
types: | ||
- closed | ||
|
||
jobs: | ||
call-asset-build: | ||
uses: terascope/workflows/.github/workflows/asset-build-and-publish.yml@f86f716e47d989b939d978befa7721c1f5b10134 | ||
if: github.event.pull_request.merged == true | ||
uses: terascope/workflows/.github/workflows/asset-build-and-publish.yml@2f96a27a56e68c64c67b03d000672f41379e368e | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import path from 'node:path'; | ||
import fse from 'fs-extra'; | ||
import semver from 'semver'; | ||
|
||
describe('Ensure asset.json, package.json and root package.json versions are in sync', () => { | ||
it('Versions are equal', () => { | ||
const pathToAssetPkgJson = path.join(process.cwd(), './asset/package.json'); | ||
const assetPkgJsonVersion = fse.readJSONSync(pathToAssetPkgJson).version; | ||
const pathToAssetJson = path.join(process.cwd(), './asset/asset.json'); | ||
const assetVersion = fse.readJSONSync(pathToAssetJson).version; | ||
const pathToRootPkgJson = path.join(process.cwd(), './package.json'); | ||
const rootVersion = fse.readJSONSync(pathToRootPkgJson).version; | ||
|
||
expect(semver.eq(assetPkgJsonVersion, rootVersion)).toBe(true); | ||
expect(semver.eq(assetVersion, rootVersion)).toBe(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters