-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: separate publish workflow to ensure order (#2782)
- Loading branch information
Showing
4 changed files
with
47 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Publish to npm | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
paths-ignore: | ||
- "docs/**" | ||
|
||
# Ensure only one workflow/job is publishing to npm at a time | ||
concurrency: publish-to-npm | ||
|
||
jobs: | ||
release: | ||
if: github.repository == 'latticexyz/mud' | ||
uses: "./.github/workflows/release.yml" | ||
secrets: inherit | ||
|
||
snapshot: | ||
if: github.repository == 'latticexyz/mud' | ||
needs: [release] | ||
uses: "./.github/workflows/snapshot.yml" | ||
secrets: inherit | ||
|
||
docker: | ||
if: github.repository == 'latticexyz/mud' | ||
needs: [release, snapshot] | ||
uses: "./.github/workflows/docker.yml" | ||
secrets: inherit | ||
|
||
test-snapshot: | ||
if: github.repository == 'latticexyz/mud' | ||
uses: ./.github/workflows/test-published-packages.yml | ||
needs: [release, snapshot] | ||
with: | ||
tag-or-version: ${{ github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
name: Release 🔖 | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
paths-ignore: | ||
- "docs/**" | ||
workflow_call: | ||
|
||
# Ensure only one workflow/job is publishing to npm at a time | ||
concurrency: publish-to-npm | ||
|
@@ -16,7 +12,6 @@ env: | |
jobs: | ||
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. | ||
|
@@ -31,20 +26,22 @@ jobs: | |
with: | ||
submodules: recursive | ||
|
||
- name: Check for pre.json file existence | ||
id: check_files | ||
uses: andstor/[email protected] | ||
with: | ||
files: ".changeset/pre.json" | ||
|
||
- name: "Setup" | ||
if: steps.check_files.outputs.files_exists == 'false' | ||
uses: ./.github/actions/setup | ||
|
||
- name: Set deployment token | ||
if: steps.check_files.outputs.files_exists == 'false' | ||
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 | ||
uses: andstor/[email protected] | ||
with: | ||
files: ".changeset/pre.json" | ||
|
||
- name: Create version PR or publish 🚀 | ||
if: steps.check_files.outputs.files_exists == 'false' | ||
uses: changesets/action@v1 | ||
|
@@ -53,7 +50,3 @@ jobs: | |
version: pnpm release:version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
docker: | ||
uses: ./.github/workflows/docker.yml | ||
needs: release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters