Skip to content

Commit

Permalink
Added auto publish to NPM and GitHub packages
Browse files Browse the repository at this point in the history
  • Loading branch information
alanrodas committed Nov 27, 2020
1 parent 7ab62b5 commit d85f2eb
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 45 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/publish.yml

This file was deleted.

25 changes: 23 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,35 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
# Add release to GitHub releases
- name: Create Release on GitHub
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ github.event.head_commit.message }}
draft: false
prerelease: false
# Setup .npmrc file to publish to npm
- name: Publish on NPM
uses: actions/setup-node@v1
with:
node-version: "14.x"
registry-url: "https://registry.npmjs.org"
- run: npm install
# Publish to NPM
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Setup .npmrc file to publish to GitHub Packages
- name: Publish on GitHub Packages
uses: actions/setup-node@v1
with:
registry-url: "https://npm.pkg.github.com"
# Publish to GitHub Packages
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- dev
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -18,7 +19,7 @@ jobs:
- 14.x
steps:
- uses: actions/checkout@v2
name: Use Node.js ${{ matrix.node-version }}
name: Run tests using Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v1
with:
node-version: "${{ matrix.node-version }}"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gobstones/gobstones-gbb-parser",
"version": "0.3.0",
"version": "0.3.1",
"description": "A Parser/Stringifier for GBB (Gobstones Board) file format",
"repository": "https://github.com/gobstones/gobstones-gbb-parser",
"author": "Alan Rodas Bonjour <alanrodas@gmail.com>",
Expand Down
3 changes: 1 addition & 2 deletions src/stringifier/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ export namespace GBBStringifyingErrors {
const secondaryMessage = intl.translate(secondaryMessageKey, values);
super(
'InvalidBoardDefinition',
intl.translate('stringifier.errors.InvalidBoardDefinition.main') +
secondaryMessage
intl.translate('stringifier.errors.InvalidBoardDefinition.main') + secondaryMessage
);
Object.setPrototypeOf(this, InvalidBoardDefinition.prototype);
}
Expand Down
7 changes: 1 addition & 6 deletions src/stringifier/stringifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,7 @@ const stringifyBoardWith = (
);
ensureOrFail(
board.head[0] >= 0 && board.head[0] < board.width,
new GBBStringifyingErrors.HeadBoundaryExceeded(
'xCoordinate',
board.head[0],
0,
board.width
)
new GBBStringifyingErrors.HeadBoundaryExceeded('xCoordinate', board.head[0], 0, board.width)
);
ensureOrFail(
board.head[1] >= 0 && board.head[1] < board.height,
Expand Down
2 changes: 1 addition & 1 deletion src/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const en: Locale = {
errors: {
language:
'You specified "${lang}" as the language, but that\'s not a valid language. Select one of ${availableLangs}.',
file: 'The file ${fileName} does not exist or cannot be read.',
file: 'The file ${fileName} does not exist or cannot be read.'
}
}
};
5 changes: 2 additions & 3 deletions src/translations/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ export const es: Locale = {
"La definición de una celda debe contener valores para 'a', 'n', 'r' and 'v', y nada más. ",
missing:
'Te está faltando un valor para la clave ${key} para la definición de la celda en la posición ${x}, ${y}.',
added:
'Aún así hay claves adicionales para la posición ${x}, ${y}.'
added: 'Aún así hay claves adicionales para la posición ${x}, ${y}.'
},
InvalidBoardDefinition: {
main:
"La cantidad de elementos en el arreglo de la definición de board debe coincidir con el ancho y alto definido para el tablero en cada uno de sus elementos",
'La cantidad de elementos en el arreglo de la definición de board debe coincidir con el ancho y alto definido para el tablero en cada uno de sus elementos',
width:
'Sin embargo el arreglo tiene ${encountered} elementos, mientras que el ancho indica que ${declared} como requerido.',
height:
Expand Down

0 comments on commit d85f2eb

Please # to comment.