Skip to content

Set main version

Set main version #324

Workflow file for this run

name: CI
on: [push]
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: yarn install --frozen-lockfile --ignore-scripts
- name: Build
run: |
yarn workspace ani-cursor build
yarn workspace webamp build
yarn workspace webamp build-library
- name: Lint
run: |
yarn lint
yarn workspace webamp type-check
- name: Run Unit Tests
run: |
touch packages/skin-database/config.js
yarn test
yarn workspace webamp test
- name: Run Integration Tests
run: yarn workspace webamp integration-tests
env:
CI: true
- name: Upload Screenshot Diffs
if: failure()
uses: actions/upload-artifact@v4
with:
name: image_diffs
path: packages/webamp/js/__tests__/__image_snapshots__/__diff_output__/
- name: Generate New Screenshots
if: failure()
run: |
yarn workspace webamp integration-tests -u
- name: Upload New Screenshots
if: failure()
uses: actions/upload-artifact@v4
with:
name: new_images
path: packages/webamp/js/__tests__/__image_snapshots__/
main-release:
name: Publish to NPM
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.repository == 'captbaritone/webamp'
needs: [build-and-test]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 20.x
registry-url: https://registry.npmjs.org/
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile --ignore-scripts
- name: Build latest (main) version
if: github.ref == 'refs/heads/main'
run: |
yarn workspace webamp build-library
echo "Setting version to 0.0.0-next-${{ env.GIT_HASH }}"
npm version -w webamp 0.0.0-next-${{ env.GIT_HASH }} --no-git-tag-version
env:
RELEASE_COMMIT_SHA: ${{ github.sha }}
- name: Build release version
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
run: exit 1 # TODO: Script to update version number in webampLazy.tsx
- name: Publish to npm
if: github.ref == 'refs/heads/main' || github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
run: |
npm publish webamp ${TAG}
env:
TAG: ${{ github.ref == 'refs/heads/main' && '--tag=main' || ((contains(github.ref_name, '-rc.') && '--tag=dev') || '' )}}
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}