diff --git a/.github/workflows/release.yml b/.github/workflows/main.yml similarity index 87% rename from .github/workflows/release.yml rename to .github/workflows/main.yml index abe6947..7ef5c81 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/main.yml @@ -1,15 +1,16 @@ -name: Release +name: Main on: push: workflow_dispatch: + workflow_call: permissions: contents: write pull-requests: write jobs: - release: - name: Build and release + main: + name: Build, test, and release runs-on: ubuntu-latest steps: - name: Checkout @@ -29,6 +30,14 @@ jobs: - name: Build run: npm pack + - name: Build example plugin to test + run: | + set -eux + + cd example + npm install ../*.tgz + npm run build + - name: Set GITHUB_RELEASE_TAG & ARTIFACT_ID run: | set -eux diff --git a/.github/workflows/update-wit.yml b/.github/workflows/update-wit.yml index 49640ca..2abd55e 100644 --- a/.github/workflows/update-wit.yml +++ b/.github/workflows/update-wit.yml @@ -4,11 +4,12 @@ on: permissions: contents: write + pull-requests: write jobs: update-wit: name: Update WIT - runs-on: ubuntu-latest + runs-on: ubuntu-slim steps: - name: Checkout uses: actions/checkout@v6 @@ -37,3 +38,8 @@ jobs: git add wit git commit -m "Sync to Pumpkin-MC/pumpkin-plugin-wit@${witCommit}" git push + + main: + name: Build, test, and release + needs: update-wit + uses: ./.github/workflows/main.yml diff --git a/example/package.json b/example/package.json new file mode 100644 index 0000000..bbdb351 --- /dev/null +++ b/example/package.json @@ -0,0 +1,5 @@ +{ + "scripts": { + "build": "pumpkin-plugin-build my-plugin.ts build/plugin.wasm" + } +}