diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index b4343888..e8feb219 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,25 +1,25 @@ name: Build and test on: - push: + push: jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Setup node.js - uses: actions/setup-node@v3 - with: - node-version: '18' - registry-url: 'https://npm.pkg.github.com' - cache: 'npm' - - name: Install dependencies - run: npm ci - env: - NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} - - name: Build application - run: npm run build - - name: Run tests - run: npm test + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: Setup node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + registry-url: 'https://npm.pkg.github.com' + cache: 'npm' + - name: Install dependencies + run: npm ci + env: + NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} + - name: Build application + run: npm run build + - name: Run tests + run: npm test diff --git a/.github/workflows/publish-beta.yaml b/.github/workflows/publish-beta.yaml index 49546e7f..607da1af 100644 --- a/.github/workflows/publish-beta.yaml +++ b/.github/workflows/publish-beta.yaml @@ -1,41 +1,40 @@ name: Publish beta -on: - workflow_dispatch +on: workflow_dispatch jobs: - publish-beta: - name: Publish to package registry - runs-on: ubuntu-latest - permissions: - contents: write - packages: write - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup node.js - uses: actions/setup-node@v2 - with: - node-version: '16.15.0' - registry-url: 'https://npm.pkg.github.com' - cache: 'npm' - - name: Bump version - run: | - git config --global user.name '${{ github.actor }}' - git config --global user.email '${{ github.actor }}@users.noreply.github.com' - npm version prerelease --preid beta - - name: Install dependencies - run: npm ci - env: - NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} - - name: Build package - run: npm run build - - name: Run tests - run: npm test - - name: Publish package - id: publish - run: npm publish --tag beta - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Push new version tag - if: steps.publish.outcome == 'success' - run: git push + publish-beta: + name: Publish to package registry + runs-on: ubuntu-latest + permissions: + contents: write + packages: write + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup node.js + uses: actions/setup-node@v2 + with: + node-version: '20' + registry-url: 'https://npm.pkg.github.com' + cache: 'npm' + - name: Bump version + run: | + git config --global user.name '${{ github.actor }}' + git config --global user.email '${{ github.actor }}@users.noreply.github.com' + npm version prerelease --preid beta + - name: Install dependencies + run: npm ci + env: + NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} + - name: Build package + run: npm run build + - name: Run tests + run: npm test + - name: Publish package + id: publish + run: npm publish --tag beta + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Push new version tag + if: steps.publish.outcome == 'success' + run: git push diff --git a/.github/workflows/publish-release.yaml b/.github/workflows/publish-release.yaml index e1030fa9..f7685354 100644 --- a/.github/workflows/publish-release.yaml +++ b/.github/workflows/publish-release.yaml @@ -1,61 +1,61 @@ name: Publish release (master only) on: - workflow_dispatch: - inputs: - releaseType: - type: choice - required: true - description: 'Release type' - default: 'patch' - options: - - patch - - minor - - major - releaseBody: - type: string - required: true - description: 'Release description' + workflow_dispatch: + inputs: + releaseType: + type: choice + required: true + description: 'Release type' + default: 'patch' + options: + - patch + - minor + - major + releaseBody: + type: string + required: true + description: 'Release description' jobs: - publish: - name: Publish to package registry - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' - permissions: - contents: write - packages: write - steps: - - name: Checkout branch - uses: actions/checkout@v2 - - name: Setup node.js - uses: actions/setup-node@v2 - with: - node-version: '16.15.0' - registry-url: 'https://npm.pkg.github.com' - cache: 'npm' - - name: Bump version - run: | - git config --global user.name '${{ github.actor }}' - git config --global user.email '${{ github.actor }}@users.noreply.github.com' - echo "VERSION_TAG=$(npm version ${{ github.event.inputs.releaseType }})" >> $GITHUB_ENV - - name: Install dependencies - run: npm ci - env: - NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} - - name: Build package - run: npm run build - - name: Run tests - run: npm test - - name: Publish package - id: publish - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Push new version tag - if: steps.publish.outcome == 'success' - run: git push - - name: Create release - uses: softprops/action-gh-release@v1 - with: - tag_name: ${{ env.VERSION_TAG }} - body: ${{ github.event.inputs.releaseBody }} + publish: + name: Publish to package registry + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' + permissions: + contents: write + packages: write + steps: + - name: Checkout branch + uses: actions/checkout@v2 + - name: Setup node.js + uses: actions/setup-node@v2 + with: + node-version: '20' + registry-url: 'https://npm.pkg.github.com' + cache: 'npm' + - name: Bump version + run: | + git config --global user.name '${{ github.actor }}' + git config --global user.email '${{ github.actor }}@users.noreply.github.com' + echo "VERSION_TAG=$(npm version ${{ github.event.inputs.releaseType }})" >> $GITHUB_ENV + - name: Install dependencies + run: npm ci + env: + NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} + - name: Build package + run: npm run build + - name: Run tests + run: npm test + - name: Publish package + id: publish + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Push new version tag + if: steps.publish.outcome == 'success' + run: git push + - name: Create release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ env.VERSION_TAG }} + body: ${{ github.event.inputs.releaseBody }}