diff --git a/.github/workflows/check-branch.yaml b/.github/workflows/check-branch.yml similarity index 71% rename from .github/workflows/check-branch.yaml rename to .github/workflows/check-branch.yml index 05442ba..4bb31fc 100644 --- a/.github/workflows/check-branch.yaml +++ b/.github/workflows/check-branch.yml @@ -10,5 +10,5 @@ jobs: - uses: actions/checkout@v4 - run: node -v - run: sudo corepack enable - - run: pnpm install --no-frozen-lockfile - - run: pnpm check-branch + - run: pnpm install + - run: pnpm check-branch \ No newline at end of file diff --git a/.github/workflows/publish-package.yaml b/.github/workflows/publish-package.yaml new file mode 100644 index 0000000..9edf47a --- /dev/null +++ b/.github/workflows/publish-package.yaml @@ -0,0 +1,32 @@ +on: + workflow_dispatch: + push: + tags: + - '*' + +name: publish-package + +jobs: + publish-package: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + - run: node -v + - run: sudo corepack enable + - run: pnpm install + - run: pnpm build + - id: get-package + run: | + package=$(echo ${{github.ref_name}} | cut -d'@' -f1) + dirname=$(find . -path ./node_modules -prune -o -name 'package.json' -exec grep -q -i "\"name\": \"@stack-spot/${package}\"" {} \; -print | rev | cut -d'/' -f2 | rev) + echo "dirname=$dirname" >> "$GITHUB_OUTPUT" + - run: | + cd packages/${{steps.get-package.outputs.dirname}} + npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..ff602db --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,17 @@ +on: + push: + branches: + - main + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + id: release + with: + token: ${{ secrets.GIT_ORG_TOKEN }} + config-file: release-please-config.json + manifest-file: .release-please-manifest.json \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..ff643aa --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,4 @@ +{ + "packages/cli": "1.1.1", + "packages/runtime": "1.4.0" +} \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..1e8f579 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,14 @@ +{ + "separate-pull-requests": true, + "include-component-in-tag": true, + "tag-separator": "@", + "packages": { + "packages/cli": { + "release-type": "node" + }, + "packages/runtime": { + "release-type": "node" + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +} \ No newline at end of file