Skip to content

Commit

Permalink
feat: clean up CI/CD piplelines
Browse files Browse the repository at this point in the history
  • Loading branch information
SethBurkart123 committed Nov 15, 2024
1 parent 0e23ea0 commit 96cf8e3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 103 deletions.
95 changes: 30 additions & 65 deletions .github/workflows/mvp.yml
Original file line number Diff line number Diff line change
@@ -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
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Install bun & Deps
run: npm install bun -g

- name: 'Build - all browsers'
id: buildProject
run: |
bun install
bun run build

- 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 }}
strategy:
matrix:
node-version: [20.x]

- 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 }}
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
38 changes: 0 additions & 38 deletions .github/workflows/testing.yml

This file was deleted.

0 comments on commit 96cf8e3

Please sign in to comment.