Skip to content
npm registry to GitHub Package Registry example.
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows add v Dec 26, 2019
lib lib-commit Dec 26, 2019
src initial commit Dec 26, 2019
test ci(test): add test Dec 26, 2019
.gitignore lib-commit Dec 26, 2019
LICENSE initial commit Dec 26, 2019
README.md
package-lock.json 2.3.2 Jan 17, 2020
package.json 2.3.2 Jan 17, 2020
tsconfig.json initial commit Dec 26, 2019

README.md

npm-github-package-example

npm registry to GitHub Package Registry example.

This repository test for GitHub Workflow.

Release Workflow

  1. [Manual] Update Version: npm vession {patch,minor,major}
  2. [Manual] Push: git push
  3. [CI] Publish to npm and Push a tag to GitHub

This Release flow is defined in .github/workflows/publish.yml

name: publish
env:
  CI: true
on:
  push:
    branches:
      - master
    tags:
      - "!*"
jobs:
  release:
    name: Setup
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v1
      - name: setup Node
        uses: actions/setup-node@v1
        with:
          node-version: 12.x
          registry-url: 'https://npm.pkg.github.com'
      - name: install
        run: npm install
      - name: test
        run: npm test
      # Publish to npm if this version is not published
      - name: Publish
        run: |
          npx can-npm-publish --verbose && npm publish || echo "Does not publish"
        env:
          NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      # Push tag to GitHub if the version's tag is not tagged
      - name: package-version-to-git-tag
        uses: azu/action-package-version-to-git-tag@v1
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          github_repo: ${{ github.repository }}
          git_commit_sha: ${{ github.sha }}

Install

Install with npm:

npm install @azu/npm-github-package-example

Usage

import { hello } from "@azu/npm-github-package-example"
hello("john"); // => "Hello, john"

Changelog

See Releases page.

Running tests

Install devDependencies and Run npm test:

npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu

You can’t perform that action at this time.