diff --git a/.github/workflows/mvp.yml b/.github/workflows/mvp.yml index 5db0140c..31bdddb2 100644 --- a/.github/workflows/mvp.yml +++ b/.github/workflows/mvp.yml @@ -1,73 +1,38 @@ -name: MVP - make, version & publish +name: NodeJS Build on: push: - branches: - - main - workflow_dispatch: # This line adds manual triggering from the GitHub UI - -concurrency: ${{ github.workflow }}-${{ github.ref }} + branches: [ "main" ] + pull_request: + branches: [ "main" ] jobs: - make_version_publish: - name: Make, Version & Publish + build: runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [20.x] + steps: - - name: Checkout Repo - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Setup Node 20.x - uses: actions/setup-node@v4 - with: - node-version: 20.x + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} - - name: Install bun & Deps - run: npm install bun -g + - name: Build + run: | + npm install + npm run build - - name: 'Build - all browsers' - id: buildProject - run: | - bun install - bun run build + - name: Zip dist folder + run: | + zip -r dist.zip dist - - name: '[ V E R S I O N ] : Create or Update Release Pull Request - Version Changes' - id: changesets - uses: changesets/action@v1 - with: - version: bun run version - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: 'Get current version info from package.json' - if: steps.changesets.outputs.hasChangesets == 'false' - id: package - run: | - echo "::set-output name=PACKAGE_NAME::$(jq -r .name package.json)" - echo "::set-output name=PACKAGE_VERSION::$(jq -r .version package.json)" - working-directory: ${{ github.workspace }} - - - name: 'Check if a git release already exists for current version' - if: steps.changesets.outputs.hasChangesets == 'false' - id: checkRelease - run: | - TAG_NAME=${{ steps.package.outputs.PACKAGE_NAME }}@${{ steps.package.outputs.PACKAGE_VERSION }} - if gh release view $TAG_NAME &>/dev/null; then - echo "Release $TAG_NAME already exists." - echo "RELEASE_EXISTS=true" >> $GITHUB_ENV - else - echo "RELEASE_EXISTS=false" >> $GITHUB_ENV - fi - - - name: 'Create Release Archive(s) - zip 🫰 it 🫰 up 🫰 !' - id: zip - if: steps.changesets.outputs.hasChangesets == 'false' - run: bun run zip - - - name: 'Create a git release w/ notes & release archive(s)' - id: gitRelease - if: steps.changesets.outputs.hasChangesets == 'false' && env.RELEASE_EXISTS != 'true' - run: bun run release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PACKAGE_NAME: ${{ steps.package.outputs.PACKAGE_NAME }} - PACKAGE_VERSION: ${{ steps.package.outputs.PACKAGE_VERSION }} + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: dist-zip + path: dist.zip \ No newline at end of file diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml deleted file mode 100644 index 31bdddb2..00000000 --- a/.github/workflows/testing.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: NodeJS Build - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [20.x] - - steps: - - uses: actions/checkout@v4 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - - name: Build - run: | - npm install - npm run build - - - name: Zip dist folder - run: | - zip -r dist.zip dist - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: dist-zip - path: dist.zip \ No newline at end of file