diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index faae40b298..74d94ed81c 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -2,10 +2,7 @@ name: Prerelease 🚀 on: push: - branches: - - "main" - paths-ignore: - - "docs/**" + workflow_dispatch: # Ensure only one workflow/job is publishing to npm at a time concurrency: publish-to-npm @@ -23,8 +20,8 @@ jobs: pull-requests: write id-token: write steps: - - uses: actions/checkout@v3 - name: Checkout Repo + - name: Checkout Repo + uses: actions/checkout@v3 with: submodules: recursive diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4e53efb3b..7bae9ff18a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,24 +1,29 @@ -name: Version 🔖 +name: Release 🔖 on: push: branches: - - v2 + - "main" + paths-ignore: + - "docs/**" # Ensure only one workflow/job is publishing to npm at a time concurrency: publish-to-npm jobs: - version: + release: name: Release if: github.repository == 'latticexyz/mud' runs-on: ubuntu-latest + # Permissions necessary for Changesets to push a new branch and open PRs + # (for automated Version Packages PRs), and request the JWT for provenance. + # More info: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#adding-permissions-settings permissions: contents: write pull-requests: write id-token: write steps: - - name: Checkout + - name: Checkout Repo uses: actions/checkout@v3 with: submodules: recursive @@ -26,17 +31,10 @@ jobs: - name: "Setup" uses: ./.github/actions/setup - - name: Clean - shell: bash - run: pnpm turbo run clean --force --concurrency 10 - - # Build without cache to ensure we release with the most accurate output - - name: Build - shell: bash - run: pnpm turbo run build --force --concurrency 10 - - - name: Outdated files, run `pnpm build` and commit them - uses: ./.github/actions/require-empty-diff + - name: Set deployment token + run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Check for pre.json file existence id: check_files @@ -44,22 +42,14 @@ jobs: with: files: ".changeset/pre.json" - - name: Set deployment token - run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" - - # https://github.com/changesets/action#with-publishing - - name: Handle Release Pull Request or Publish to npm - id: changesets + - name: Create version PR or publish 🚀 if: steps.check_files.outputs.files_exists == 'false' uses: changesets/action@v1 with: - title: "chore: version packages 🔖" - commit: "chore: version packages 🔖" publish: pnpm release:publish version: pnpm release:version env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} docker: uses: ./.github/workflows/docker.yml diff --git a/packages/store/mud.config.ts b/packages/store/mud.config.ts index c5fd5335e1..f29127e708 100644 --- a/packages/store/mud.config.ts +++ b/packages/store/mud.config.ts @@ -1,6 +1,12 @@ +import { Enums } from "./ts/config/v2"; import { defineStore } from "./ts/config/v2/store"; +const enums = { + Hello: ["First", "Second"], +} as const satisfies Enums; + export default defineStore({ + enums, codegen: { storeImportPath: "../../", },