diff --git a/.github/workflows/cicd.yaml b/.github/workflows/cicd.yaml deleted file mode 100644 index 5839467..0000000 --- a/.github/workflows/cicd.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: CI/CD - -on: - pull_request: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [20.x] - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - registry-url: 'https://registry.npmjs.org/' - - run: npm ci - - run: npm run build --if-present - - run: npm test - - publish-npm: - runs-on: ubuntu-latest - needs: build - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - steps: - - uses: actions/checkout@v3 - - name: Use Node.js - uses: actions/setup-node@v3 - with: - node-version: '20.x' - registry-url: 'https://registry.npmjs.org/' - - run: npm ci - - run: npm run build --if-present - - run: npm publish --access=public - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..6ed90fc --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,30 @@ +name: Build & Test + +on: + pull_request: + push: + branches: + - main + +jobs: + build: + name: build & test + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20.x" + registry-url: 'https://registry.npmjs.org/' + + - name: Install Node dependencies + run: npm ci + + - name: Run Node build (if present) + run: npm run build --if-present + + - name: Run Tests (if present) + run: npm test --if-present diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bbf73dc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release +on: + push: + tags: + - "v*" + +jobs: + release: + name: release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: "20.x" + registry-url: 'https://registry.npmjs.org/' + + - name: Install Node dependencies + run: npm ci + + - name: Update version in package.json + run: | + TAG_VERSION=${GITHUB_REF#refs/tags/} + npm version $TAG_VERSION --no-git-tag-version + + - name: Run Node build (if present) + run: npm run build --if-present + + - name: Publish NPM package + run: npm publish --access=public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/package.json b/package.json index 06f4e37..322fa96 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@qpoint/testing", - "version": "0.0.7", + "version": "0.0.0", "description": "A suite of testing utilitiess for QPoint middleware.", "author": "Jon Friesen ", "homepage": "https://github.com/qpoint-io/qpoint-testing#readme",