diff --git a/.github/workflows/alienmark-package-publish.yml b/.github/workflows/alienmark-package-publish.yml new file mode 100644 index 00000000..c2798b6b --- /dev/null +++ b/.github/workflows/alienmark-package-publish.yml @@ -0,0 +1,66 @@ +name: "AlienMark: Publish Package" + +on: + workflow_dispatch: + +permissions: + contents: read + packages: write + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Ensure main branch + if: github.ref != 'refs/heads/main' + run: | + echo "::error::AlienMark package publishing is only allowed from the main branch." + exit 1 + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + with: + run_install: false + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "24" + cache: "pnpm" + cache-dependency-path: pnpm-lock.yaml + registry-url: "https://npm.pkg.github.com" + scope: "@lazyalienserver" + + - name: Enable Corepack + run: corepack enable + + - name: Install workspace dependencies + run: pnpm install --frozen-lockfile + + - name: Run AlienMark type check + run: pnpm --filter alienmark check + + - name: Run AlienMark tests + run: pnpm --filter alienmark test + + - name: Build AlienMark + run: pnpm --filter alienmark build + + - name: Configure package metadata for GitHub Packages + working-directory: packages/alienmark + run: | + npm pkg set name="@lazyalienserver/alienmark" + npm pkg set publishConfig.registry="https://npm.pkg.github.com" + npm pkg set repository.type="git" + npm pkg set repository.url="git+https://github.com/LazyAlienServer/alien-commons.git" + npm pkg set repository.directory="packages/alienmark" + + - name: Publish AlienMark to GitHub Packages + working-directory: packages/alienmark + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npm publish