Skip to content

Commit

Permalink
Merge pull request #48 from eufelipemateus/dev
Browse files Browse the repository at this point in the history
Upgrade Dependencies
  • Loading branch information
eufelipemateus authored Jun 15, 2022
2 parents 97f53c1 + 010b167 commit 902ae6f
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 4,792 deletions.
96 changes: 60 additions & 36 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,63 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Node.js Package

name: release
on:
push:
tags:
- 'v*'
release:
types: [published]

release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- run: npm ci
- run: npm test
release:
runs-on: ubuntu-latest
steps:
# Checkout the exact commit tagged on the release.
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.release.target_commitish }}

# This is the action in this repo! 👇
# Note we set an `id` called `release`. We'll use that later...
- name: Validate and extract release information
id: release
uses: manovotny/github-releases-for-automated-package-publishing-action@v1.0.0

# When setting the node version for publishing a release, it's also impotant
# to set `always-auth` and `registry-url` too. I've encountered vauge errors
# and publishing doesn't work unless they are supplied.
#
# This example is using NPM's registry. If you were publishing to GitHub's
# Package registry, you'd use `https://npm.pkg.github.com` instead.
- name: Set node version
uses: actions/setup-node@v2
with:
always-auth: true
node-version: '12.x'
registry-url: 'https://npm.pkg.github.com'

# Perform installs, run tests, run a build step, etc. here, as needed.

# The last two steps will publish the package. Note that we're using
# information from the `release` step above (I told you we'd use it
# later). Notice the `if` statements on both steps...
#
# If there *is* a tag (ie. `beta`, `canary`, etc.), we publish a
# "pre-release" or "tagged" version of a package (ie. 1.2.3-beta.1).
#
# If there *is not* a tag (ie. `beta`, `canary`, etc.), we publish a
# version of a package (ie. 1.2.3).
#
# This example is using yarn to publish, but you could just as easily
# use npm, if you prefer. It's also publishing to the NPM registry,
# thus, it's using `NPM_TOKEN`, but you could just as easily use
# `GITHUB_TOKEN` if you were publishing to the GitHub Package registry.

# This will publish a "pre-release" or "tagged" version of a package.
- name: Publish tagged version
if: steps.release.outputs.tag != ''
run: yarn publish --new-version ${{ steps.release.outputs.version }} --tag ${{ steps.release.outputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
# This will publish a version of a package.
- name: Publish version
if: steps.release.outputs.tag == ''
run: yarn publish --new-version ${{ steps.release.outputs.version }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 902ae6f

Please sign in to comment.