Publish Dev Build #27
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 Build | |
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] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/checkout@v3 | |
with: | |
version: latest | |
- name: Install Dependencies | |
run: npm i | |
- name: Set Version | |
run: | | |
git config user.email "<>" | |
git config user.name "GitHub Actions" | |
npm --no-git-tag-version 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 | |
- uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
tag: dev | |
- name: Deprecate Old Versions | |
run: npx -y npm-deprecate | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |