feat: public releases package

This commit is contained in:
Mo
2022-06-20 10:53:42 -05:00
parent 3642fc882a
commit 4fea3e9a6b
7 changed files with 69 additions and 2 deletions

View File

@@ -8,6 +8,8 @@ jobs:
Build:
if: contains(github.event.head_commit.message, 'chore(release)') == false
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v2
@@ -36,7 +38,9 @@ jobs:
continue-on-error: true
id: graduateRelease
if: ${{ github.ref == 'refs/heads/main' }}
run: yarn release:prod:graduate
run: |
yarn release:prod:graduate
yarn publish:prod
- name: Bump Prod Version Fallback
if: ${{ always() && github.ref == 'refs/heads/main' && steps.graduateRelease.outcome == 'failure' }}
@@ -44,7 +48,10 @@ jobs:
echo Falling back to non-graduate release due to https://github.com/lerna/lerna/issues/2532
git stash
yarn release:prod
yarn publish:prod
- name: Bump Beta Version
if: ${{ github.ref == 'refs/heads/develop' }}
run: yarn release:beta
run: |
yarn release:beta
yarn publish:beta

View File

@@ -28,6 +28,8 @@
"release:prod": "lerna version --conventional-commits --yes -m \"chore(release): publish\"",
"release:prod:graduate": "lerna version --conventional-graduate --conventional-commits --yes -m \"chore(release): publish\"",
"release:beta": "lerna version --conventional-prerelease --conventional-commits --yes -m \"chore(release): publish\"",
"publish:prod": "lerna publish from-git --yes",
"publish:beta": "lerna publish from-git --yes --dist-tag alpha",
"version": "yarn install --no-immutable && git add yarn.lock",
"postversion": "./scripts/push-tags-one-by-one.sh",
"lerna:list": " yarn lerna list -all",

6
packages/releases/dist/releases.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"@standardnotes/components-meta": "2.1.6",
"@standardnotes/desktop": "3.22.12-alpha.2",
"@standardnotes/mobile": "3.23.8-alpha.0",
"@standardnotes/web": "3.23.0-alpha.1"
}

View File

@@ -0,0 +1,15 @@
import Components from '../components/package.json' assert { type: 'json' }
import Desktop from '../desktop/package.json' assert { type: 'json' }
import Mobile from '../mobile/package.json' assert { type: 'json' }
import Web from '../web/package.json' assert { type: 'json' }
import { writeJson, ensureDirExists } from '../../scripts/ScriptUtils.mjs'
const Releases = {
[Components.name]: Components.version,
[Desktop.name]: Desktop.version,
[Mobile.name]: Mobile.version,
[Web.name]: Web.version,
}
ensureDirExists('dist')
writeJson(Releases, 'dist/releases.json')

View File

@@ -0,0 +1,23 @@
{
"name": "@standardnotes/releases",
"version": "1.0.0",
"license": "AGPL-3.0-or-later",
"main": "dist/releases.json",
"private": false,
"publishConfig": {
"access": "public"
},
"author": "Standard Notes",
"description": "Standard Notes client release versions",
"engines": {
"node": ">=12.19.0 <17.0.0"
},
"scripts": {
"build": "node index.mjs",
"version": "yarn build"
},
"devDependencies": {
"@types/node": "*",
"typescript": "*"
}
}

View File

@@ -23,3 +23,8 @@ export const emptyExistingDir = (dir) => {
export const listDirFiles = (dir) => {
return fs.readdirSync(dir)
}
export const writeJson = (data, path) => {
const string = JSON.stringify(data, null, 2)
return fs.writeFileSync(path, string)
}

View File

@@ -5789,6 +5789,15 @@ __metadata:
languageName: node
linkType: hard
"@standardnotes/releases@workspace:packages/releases":
version: 0.0.0-use.local
resolution: "@standardnotes/releases@workspace:packages/releases"
dependencies:
"@types/node": "*"
typescript: "*"
languageName: unknown
linkType: soft
"@standardnotes/responses@npm:^1.6.36":
version: 1.6.36
resolution: "@standardnotes/responses@npm:1.6.36"