From 93dcfd6383005320bb5fd3d28dec68a4a79dd7de Mon Sep 17 00:00:00 2001 From: aleidk Date: Tue, 18 Feb 2025 16:41:11 -0300 Subject: [PATCH] chore: add build step --- .forgejo/workflows/publish.yml | 45 ++++++++++++++++++++++++++++++++++ package.json | 6 ++++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 .forgejo/workflows/publish.yml diff --git a/.forgejo/workflows/publish.yml b/.forgejo/workflows/publish.yml new file mode 100644 index 0000000..7b80359 --- /dev/null +++ b/.forgejo/workflows/publish.yml @@ -0,0 +1,45 @@ +name: Publish package +on: + push: + branches: + - main + workflow_dispatch: +env: + NPM_TAG: ${{ github.ref == 'refs/heads/main' && 'latest' || 'next' }} + +# Variables reference: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/accessing-contextual-information-about-workflow-runs#about-contexts +# Syntax reference: https://forgejo.org/docs/latest/user/actions/ +jobs: + build_and_publish: + runs-on: docker + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Cache Bun dependencies + id: cache + uses: actions/cache@v4 + with: + path: ~/.bun/install/cache + key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }} + restore-keys: | + ${{ runner.os }}-bun- + + - name: Setup Bun + id: "setup_bun" + uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + run: "bun install --production" + + - name: Bump version and publish + uses: https://github.com/cocogitto/cocogitto-action@v3.10 + env: + NPM_REGISTRY_TOKEN: ${{ secrets.NPM_TOKEN_FORGEJO }} + with: + release: true + check-latest-tag-only: true + git-user: 'Cog Bot' + git-user-email: 'cog@alecodes.page' diff --git a/package.json b/package.json index 1e37d81..ac4f465 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,12 @@ { - "name": "bun-static-plugin", + "name": "@alecodes/bun-static-builder", + "version": "0.0.0", "module": "src/index.ts", "bin": "src/cli.ts", "type": "module", + "scripts": { + "ci:publish": "bun publish --production --frozen-lockfile --silent" + }, "devDependencies": { "@mini-strap/core": "^0.1.2", "@types/bun": "latest",