-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b92b99a
commit e65940d
Showing
4 changed files
with
57 additions
and
1 deletion.
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,35 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.elm | ||
~/.npm | ||
**/elm-stuff | ||
**/node_modules | ||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
- run: npm run check-versions | ||
- run: npm install | ||
- uses: dillonkearns/elm-publish-action@v1 | ||
id: elm-package-publish | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-elm: ./node_modules/.bin/elm | ||
- if: steps.elm-package-publish.outputs.is-publishable == 'true' | ||
run: npm run runner:compile && npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
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
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,13 @@ | ||
const packageJson = require("../package.json"); | ||
const elmJson = require("../elm.json"); | ||
|
||
check(); | ||
|
||
function check() { | ||
if (packageJson.version === elmJson.version) { | ||
process.exit(0); | ||
} else { | ||
console.error("ERROR: elm and npm package versions do not match."); | ||
process.exit(1); | ||
} | ||
} |