Skip to content

Commit

Permalink
Publish to npm
Browse files Browse the repository at this point in the history
Signed-off-by: macdonst <simon.macdonald@gmail.com>
  • Loading branch information
macdonst committed Jan 15, 2024
1 parent affeac4 commit b4b4fa8
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
38 changes: 37 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ jobs:
strategy:
matrix:
node-version: [ 14.x, 16.x, 18.x ]
os: [ windows-latest, ubuntu-latest, macOS-latest, self-hosted ]
# Temporarily disable self-hosted
os: [ windows-latest, ubuntu-latest, macOS-latest ]
# Node.js does not have a build of 14.x for Apple Silicon
exclude:
- os: self-hosted
Expand Down Expand Up @@ -65,6 +66,41 @@ jobs:

# ----- Only git tag testing + release deployment beyond this point ----- #

# Publish the build to npm
publish-npm:
# Setup
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, self-hosted ]

# Go
steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install
run: npm i

- name: Publish @RC to npm
if: contains(github.ref, 'RC')
run: npm publish --tag RC --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish @latest to npm
if: contains(github.ref, 'RC') == false #'!contains()'' doesn't work lol
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# Publish the build to S3
publish:
# Setup
Expand Down
33 changes: 33 additions & 0 deletions game.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"id": "Game",
"$id": "Game",
"type": "object",
"required": [
"date", "time", "facility"
],
"properties": {
"date": {
"type": "string",
"format": "date"
},
"time": {
"type": "string",
"format": "time"
},
"facility": {
"type": "string"
},
"players": {
"type": "array",
"items": {
"$ref": "#/definitions/Player"
}
}
},
"definitions": {
"Player": {
"$ref": "player.schema.json"
}
}
}

0 comments on commit b4b4fa8

Please sign in to comment.