https://github.com/menduz/oddish-action
Github action to publish packages to NPM
https://github.com/menduz/oddish-action
Last synced: about 2 months ago
JSON representation
Github action to publish packages to NPM
- Host: GitHub
- URL: https://github.com/menduz/oddish-action
- Owner: menduz
- License: apache-2.0
- Created: 2020-04-18T17:10:27.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-03T18:55:13.000Z (4 months ago)
- Last Synced: 2025-04-11T19:43:32.173Z (about 2 months ago)
- Language: JavaScript
- Size: 3.64 MB
- Stars: 2
- Watchers: 2
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Oddish GitHub Action
## How it works
`oddish` will:
Publish in @latest on semver tags, only if the new version is greater to the latest published.
Publish in @tag-[GIT_TAG] on non-semver tags.
Publish in @rc all relase candidates (extracted from the tag).
Publish in @next every main or master build.
Publish in @YYY when the branch is `branch-to-custom-tag` where `YYY` is the value set in `custom-tag`.This publishing method ignores completely the `version` field in package.json files, it publishes based on branches, tags and published versions.
## Usage
Add `oddish-action` to the workflow for your NPM package. The below example will publish your application on pushes to the `main/master` branch:
```yaml
name: Deployon:
push:
branches:
- masterjobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
steps:
- uses: actions/checkout@master- run: npm run build
- name: Publish
uses: menduz/[email protected]
with:
### Working directory to publish
# cwd: "./packages/package-a"### Optional registry to set up for auth. Will set the registry in a
### project level .npmrc and .yarnrc file, and set up auth to read in
### from env.NODE_AUTH_TOKEN
# registry-url: "https://registry.npmjs.org"### Optional scope for authenticating against scoped registries
# scope: dcl
# access: public## use action runId instead of current date to generate snapshot numbers
# deterministic-snapshot: false## Only update package.json, skip publishing
# only-update-versions: false### Set always-auth in npmrc
# always-auth: true### Gitlab pipeline trigger
# gitlab-token: asdasd123
# gitlab-pipeline-url: https://gitlab.example.com/api/v4/projects/9/trigger/pipeline### Publish to S3
# s3-bucket: my-cdn-bucket
# s3-bucket-key-prefix: cdn/${{ github.base }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
```