Publish Dev Version #144
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Dev Version | |
on: | |
workflow_call: | |
secrets: | |
NPM_TOKEN: | |
required: true | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: ESLint | |
uses: ./.github/workflows/lint.yml | |
publish: | |
runs-on: ubuntu-latest | |
needs: [lint] | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install PNPM | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 9 | |
run_install: false | |
- name: Install Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: pnpm | |
registry-url: https://registry.npmjs.org/ | |
- name: Install Dependencies | |
run: pnpm i --frozen-lockfile --ignore-scripts | |
- name: Set Version | |
run: | | |
git config user.email "<>" | |
git config user.name "GitHub Actions" | |
pnpm version --no-git-tag-version patch | |
hash=$(git rev-parse --short dev) | |
version=$(jq -r .version package.json) | |
v="$version-dev.$hash" | |
echo "Setting Version: $v" | |
contents=$(jq --arg version "$v" '.version = $version' package.json) && echo -E "${contents}" > package.json | |
- name: Publish | |
run: pnpm publish --provenance --no-git-checks --tag dev --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Deprecate Old Versions | |
run: npx -y npm-deprecate | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |