Publish Dev Build #31
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 | |
TEST_APP_TOKEN: | |
required: true | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: ESLint | |
uses: ./.github/workflows/lint.yml | |
testing: | |
name: Feature Testing | |
uses: ./.github/workflows/feature-testing.yml | |
secrets: inherit | |
publish: | |
runs-on: ubuntu-latest | |
needs: [lint, testing] | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: npm install | |
- name: Set Version | |
run: | | |
git config user.email "your-email@example.com" | |
git config user.name "GitHub Actions" | |
npm --no-git-tag-version version patch | |
hash=$(git rev-parse --short HEAD) | |
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: Print npm config | |
run: npm config list | |
- name: Update npm | |
run: npm install -g npm@latest | |
- name: Publish | |
run: npm publish --registry=https://registry.npmjs.org/ --tag dev --provenance --access public --no-git-checks --loglevel verbose | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Deprecate Old Versions | |
run: npx npm-deprecate | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |