-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure github actions to do npm @next releases
Use tags with -pre postfix to run the workflow Only run if current versions are different from published
- Loading branch information
Showing
7 changed files
with
127 additions
and
25 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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Prerelease | ||
|
||
on: | ||
# only run when tagged with VER-pre* tag | ||
push: | ||
tags: | ||
- '*-pre*' | ||
# only run if tests are finished | ||
workflow_run: | ||
workflows: ['Test'] | ||
branches: [main] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
publish-client: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
registry-url: 'https://registry.npmjs.org' | ||
# get versions for currently published and local packages | ||
- name: check versions | ||
id: versions | ||
run: | | ||
echo "current=$(npm info exoframe-client@next version || echo 'no published package yet')" >> $GITHUB_OUTPUT | ||
echo "new=$(npm info ./packages/exoframe-client version)" >> $GITHUB_OUTPUT | ||
# install and publish if local version is not the same as published | ||
- name: install | ||
if: ${{ steps.versions.outputs.current != steps.versions.outputs.new }} | ||
run: npm ci | ||
- name: publish | ||
if: ${{ steps.versions.outputs.current != steps.versions.outputs.new }} | ||
run: npm publish --access public --tag next -w exoframe-client | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
publish-cli: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
registry-url: 'https://registry.npmjs.org' | ||
# get versions for currently published and local packages | ||
- name: check versions | ||
id: versions | ||
run: | | ||
echo "current=$(npm info exoframe@next version || echo 'no published package yet')" >> $GITHUB_OUTPUT | ||
echo "new=$(npm info ./packages/exoframe-cli version)" >> $GITHUB_OUTPUT | ||
# install, build and publish if local version is not the same as published | ||
- name: install | ||
if: ${{ steps.versions.outputs.current != steps.versions.outputs.new }} | ||
run: npm ci | ||
- name: build | ||
if: ${{ steps.versions.outputs.current != steps.versions.outputs.new }} | ||
run: npm run build -w exoframe | ||
- name: publish | ||
if: ${{ steps.versions.outputs.current != steps.versions.outputs.new }} | ||
run: npm publish --access public --tag next -w exoframe | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
publish-server: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
cache: 'npm' | ||
registry-url: 'https://registry.npmjs.org' | ||
# get versions for currently published and local packages | ||
- name: check versions | ||
id: versions | ||
run: | | ||
echo "current=$(npm info exoframe-server@next version || echo 'no published package yet')" >> $GITHUB_OUTPUT | ||
echo "new=$(npm info ./packages/exoframe-server version)" >> $GITHUB_OUTPUT | ||
# install and publish if local version is not the same as published | ||
- name: install | ||
if: ${{ steps.versions.outputs.current != steps.versions.outputs.new }} | ||
run: npm ci | ||
- name: publish | ||
if: ${{ steps.versions.outputs.current != steps.versions.outputs.new }} | ||
run: npm publish --access public --tag next -w exoframe-server | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,2 +1,2 @@ | ||
lib/ | ||
dist/ | ||
test/fixtures/config-test/exoframe.json |
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,14 +1,17 @@ | ||
{ | ||
"name": "exoframe", | ||
"version": "7.0.0", | ||
"description": "Exoframe is a self-hosted tool that allows simple one-command deployments using Docker", | ||
"main": "src/index.js", | ||
"version": "7.0.0-pre+alpha.1", | ||
"description": "CLI for Exoframe, self-hosted deployment tool", | ||
"main": "dist/index.js", | ||
"type": "module", | ||
"repository": "[email protected]:exoframejs/exoframe.git", | ||
"author": "Tim Ermilov <[email protected]>", | ||
"license": "MIT", | ||
"files": [ | ||
"dist/*" | ||
], | ||
"scripts": { | ||
"build": "babel src --out-dir lib/ --watch", | ||
"build": "ncc build index.js -o dist", | ||
"lint": "eslint src/ test/", | ||
"test": "TZ=Greenland NODE_ENV=testing FORCE_COLOR=false vitest", | ||
"test:ci": "TZ=Greenland NODE_ENV=testing FORCE_COLOR=false vitest run --coverage" | ||
|
@@ -18,7 +21,7 @@ | |
"chalk": "^5.0.1", | ||
"cli-table3": "^0.6.3", | ||
"commander": "^9.3.0", | ||
"exoframe-client": "^7.0.0", | ||
"exoframe-client": "^7.0.0-pre", | ||
"got": "^12.1.0", | ||
"inquirer": "^9.1.0", | ||
"lodash": "^4.17.21", | ||
|
@@ -27,6 +30,7 @@ | |
"pretty-bytes": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"@vercel/ncc": "^0.34.0", | ||
"@vitest/coverage-c8": "^0.25.1", | ||
"c8": "^7.11.3", | ||
"eslint": "^8.1.0", | ||
|
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,7 +1,7 @@ | ||
{ | ||
"name": "exoframe-client", | ||
"version": "7.0.0", | ||
"description": "Exoframe is a self-hosted tool that allows simple one-command deployments using Docker", | ||
"version": "7.0.0-pre+alpha.1", | ||
"description": "API client for Exoframe server, self-hosted deployment tool", | ||
"main": "index.js", | ||
"repository": "[email protected]:exoframejs/exoframe.git", | ||
"author": "Tim Ermilov <[email protected]>", | ||
|
@@ -10,8 +10,7 @@ | |
"scripts": { | ||
"lint": "eslint src/", | ||
"test": "TZ=Greenland NODE_ENV=testing vitest", | ||
"test:ci": "TZ=Greenland NODE_ENV=testing vitest run --coverage", | ||
"coveralls": "cat ./coverage/lcov.info | coveralls" | ||
"test:ci": "TZ=Greenland NODE_ENV=testing vitest run --coverage" | ||
}, | ||
"dependencies": { | ||
"got": "^12.1.0", | ||
|
This file was deleted.
Oops, something went wrong.
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