Skip to content

Commit

Permalink
ci: add publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignigena authored Dec 20, 2024
1 parent 4bc41f5 commit 90e9175
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 5 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish

on:
workflow_dispatch:
inputs:
version:
required: true
type: choice
options:
- prerelease
- patch
- minor
- major

jobs:
npm:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- uses: actions/setup-node@v4
with:
cache: npm
node-version-file: .nvmrc
registry-url: https://npm.pkg.github.com/
scope: '@mapquest'
- name: Run git config
run: |
git config user.name GitHub
git config user.email [email protected]
- run: npm version ${{ github.event.inputs.version }}
- run: git push origin main --follow-tags
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run npm publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 11 additions & 4 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
*.swp
node_modules
npm-debug.log
*.spec.*
.devcontainer/
.eslint*
.git*
parse.py
data.csv
.nvmrc
benchmark/
coverage/
codes.csv
functions.js
data.csv
data.js
jest.config.js
Makefile
node_modules
npm-debug.log
parse.py
test
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"main": "./iso3166.min.js",
"scripts": {
"benchmark": "node ./benchmark/index.js",
"test": "jest ."
"test": "jest .",
"prepublish": "make"
},
"devDependencies": {
"@mapquest/team": "^0.3.8",
Expand Down

0 comments on commit 90e9175

Please sign in to comment.