Skip to content

Commit

Permalink
Merge pull request #987 from terascope/automate-release
Browse files Browse the repository at this point in the history
Automate release
  • Loading branch information
sotojn authored Jan 17, 2025
2 parents 4431ff7 + 12debf0 commit 2ba1022
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 10 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/build-and-publish-asset.yml
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
2 changes: 1 addition & 1 deletion asset/asset.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "standard",
"version": "1.3.0",
"version": "1.3.1",
"description": "Teraslice standard processor asset bundle",
"minimum_teraslice_version": "2.0.0"
}
2 changes: 1 addition & 1 deletion asset/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "standard",
"displayName": "Asset",
"version": "1.3.0",
"version": "1.3.1",
"private": true,
"description": "Teraslice standard processor asset bundle",
"repository": {
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "standard-assets-bundle",
"displayName": "Standard Assets Bundle",
"version": "1.3.0",
"version": "1.3.1",
"private": true,
"description": "Teraslice standard processor asset bundle",
"type": "module",
Expand Down Expand Up @@ -34,20 +34,25 @@
"@terascope/scripts": "~1.9.0",
"@terascope/standard-asset-apis": "~1.0.3",
"@types/express": "~4.17.19",
"@types/fs-extra": "~11.0.4",
"@types/jest": "~29.5.14",
"@types/json2csv": "~5.0.7",
"@types/node": "~22.10.6",
"@types/node-gzip": "~1.1.0",
"@types/semver": "~7.5.8",
"@types/timsort": "~0.3.0",
"eslint": "~9.18.0",
"fs-extra": "~11.3.0",
"jest": "~29.7.0",
"jest-extended": "~4.0.2",
"node-notifier": "~10.0.1",
"semver": "~7.6.3",
"teraslice-test-harness": "~1.3.1",
"ts-jest": "~29.2.5",
"tslib": "~2.8.1",
"typescript": "~5.7.3"
},
"packageManager": "yarn@4.6.0",
"engines": {
"node": ">=18.0.0",
"yarn": ">=1.22.19"
Expand All @@ -60,6 +65,5 @@
"unit": []
}
}
},
"packageManager": "yarn@4.6.0"
}
}
17 changes: 17 additions & 0 deletions test/version-sync-spec.ts
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);
});
});
41 changes: 41 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1759,6 +1759,16 @@ __metadata:
languageName: node
linkType: hard

"@types/fs-extra@npm:~11.0.4":
version: 11.0.4
resolution: "@types/fs-extra@npm:11.0.4"
dependencies:
"@types/jsonfile": "npm:*"
"@types/node": "npm:*"
checksum: 10c0/9e34f9b24ea464f3c0b18c3f8a82aefc36dc524cc720fc2b886e5465abc66486ff4e439ea3fb2c0acebf91f6d3f74e514f9983b1f02d4243706bdbb7511796ad
languageName: node
linkType: hard

"@types/geojson@npm:^7946.0.10, @types/geojson@npm:^7946.0.14":
version: 7946.0.14
resolution: "@types/geojson@npm:7946.0.14"
Expand Down Expand Up @@ -1847,6 +1857,15 @@ __metadata:
languageName: node
linkType: hard

"@types/jsonfile@npm:*":
version: 6.1.4
resolution: "@types/jsonfile@npm:6.1.4"
dependencies:
"@types/node": "npm:*"
checksum: 10c0/b12d068b021e4078f6ac4441353965769be87acf15326173e2aea9f3bf8ead41bd0ad29421df5bbeb0123ec3fc02eb0a734481d52903704a1454a1845896b9eb
languageName: node
linkType: hard

"@types/keyv@npm:^3.1.4":
version: 3.1.4
resolution: "@types/keyv@npm:3.1.4"
Expand Down Expand Up @@ -1936,6 +1955,13 @@ __metadata:
languageName: node
linkType: hard

"@types/semver@npm:~7.5.8":
version: 7.5.8
resolution: "@types/semver@npm:7.5.8"
checksum: 10c0/8663ff927234d1c5fcc04b33062cb2b9fcfbe0f5f351ed26c4d1e1581657deebd506b41ff7fdf89e787e3d33ce05854bc01686379b89e9c49b564c4cfa988efa
languageName: node
linkType: hard

"@types/send@npm:*":
version: 0.17.4
resolution: "@types/send@npm:0.17.4"
Expand Down Expand Up @@ -4709,6 +4735,17 @@ __metadata:
languageName: node
linkType: hard

"fs-extra@npm:~11.3.0":
version: 11.3.0
resolution: "fs-extra@npm:11.3.0"
dependencies:
graceful-fs: "npm:^4.2.0"
jsonfile: "npm:^6.0.1"
universalify: "npm:^2.0.0"
checksum: 10c0/5f95e996186ff45463059feb115a22fb048bdaf7e487ecee8a8646c78ed8fdca63630e3077d4c16ce677051f5e60d3355a06f3cd61f3ca43f48cc58822a44d0a
languageName: node
linkType: hard

"fs-minipass@npm:^3.0.0":
version: 3.0.3
resolution: "fs-minipass@npm:3.0.3"
Expand Down Expand Up @@ -8814,15 +8851,19 @@ __metadata:
"@terascope/scripts": "npm:~1.9.0"
"@terascope/standard-asset-apis": "npm:~1.0.3"
"@types/express": "npm:~4.17.19"
"@types/fs-extra": "npm:~11.0.4"
"@types/jest": "npm:~29.5.14"
"@types/json2csv": "npm:~5.0.7"
"@types/node": "npm:~22.10.6"
"@types/node-gzip": "npm:~1.1.0"
"@types/semver": "npm:~7.5.8"
"@types/timsort": "npm:~0.3.0"
eslint: "npm:~9.18.0"
fs-extra: "npm:~11.3.0"
jest: "npm:~29.7.0"
jest-extended: "npm:~4.0.2"
node-notifier: "npm:~10.0.1"
semver: "npm:~7.6.3"
teraslice-test-harness: "npm:~1.3.1"
ts-jest: "npm:~29.2.5"
tslib: "npm:~2.8.1"
Expand Down

0 comments on commit 2ba1022

Please sign in to comment.