mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 01:40:08 +00:00
ci(npm): publish to npm on tag creation (#1997)
* Create npm.yml * fix invalid on * Update dnt.ts * Update npm.yml
This commit is contained in:
33
.github/workflows/npm.yml
vendored
Normal file
33
.github/workflows/npm.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: NPM Publish
|
||||
|
||||
on:
|
||||
create:
|
||||
tags:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
deno: ["v1.x"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: denoland/setup-deno@main
|
||||
with:
|
||||
deno-version: ${{ matrix.deno }}
|
||||
# Taken from: https://github.com/denoland/dnt#github-actions---npm-publish-on-tag
|
||||
- name: Get tag version
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
id: get_tag_version
|
||||
run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16.x'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- name: npm build
|
||||
run: deno run -A ./dnt.ts ${{steps.get_tag_version.outputs.TAG_VERSION}}
|
||||
- name: npm publish
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: cd npm && npm publish
|
||||
Reference in New Issue
Block a user