-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: unify addressable and non-addressable workflows (#37)
BREAKING CHANGE: The ISceneManager, ISceneLoader and ILoadSceneInfo interfaces have been changed to accomodate the unification of addressable and non-addressable workflows. Refer to the migration guide at https://github.com/mygamedevtools/scene-loader/wiki/Migration-Guide-3.x for more details
- Loading branch information
Showing
149 changed files
with
3,096 additions
and
3,402 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,19 @@ | ||
name: 🚀 Release (Preview) | ||
on: | ||
push: | ||
branches: | ||
- 'feat/**' | ||
- 'fix/**' | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
create-preview-release: | ||
name: Pre Release | ||
uses: ./.github/workflows/release-template.yml | ||
with: | ||
blockPullRequestRelease: false | ||
blockReleaseCommit: true | ||
secrets: | ||
githubToken: ${{ secrets.GH_TOKEN }} | ||
|
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,91 @@ | ||
name: 🚀 Release Package | ||
on: | ||
workflow_call: | ||
inputs: | ||
blockPullRequestRelease: | ||
required: false | ||
type: boolean | ||
default: true | ||
blockReleaseCommit: | ||
required: false | ||
type: boolean | ||
dryRun: | ||
required: false | ||
type: boolean | ||
secrets: | ||
githubToken: | ||
required: true | ||
|
||
jobs: | ||
semantic-release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
new_release_published: ${{ steps.release.outputs.new_release_published }} | ||
new_release_version: ${{ steps.release.outputs.new_release_version }} | ||
steps: | ||
- name: 📂 Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
# Removes the git plugin from semantic release so it doesn't generate a new commit | ||
- name: ✂️ Disable semantic release commit | ||
if: ${{ inputs.blockReleaseCommit == true }} | ||
run: | | ||
cat .releaserc.json | jq 'del(.plugins[] | select(type == "array" and .[0] == "@semantic-release/git"))' .releaserc.json > .releaserc.json.tmp && mv .releaserc.json.tmp .releaserc.json | ||
- name: 🚀 Semantic Release | ||
id: release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
with: | ||
dry_run: ${{ inputs.dryRun }} | ||
ci: ${{ inputs.blockPullRequestRelease }} | ||
env: | ||
GH_TOKEN: ${{ secrets.githubToken }} | ||
- name: 📄 Summary | ||
run: | | ||
if [ '${{ steps.release.outputs.new_release_published }}' == 'true' ] && [ '${{ inputs.dryRun }}' == 'false' ]; then | ||
echo "ℹ️ Released version \`${{ steps.release.outputs.new_release_version }}\`" | tee -a $GITHUB_STEP_SUMMARY | ||
else | ||
echo "ℹ️ No version released" | tee -a $GITHUB_STEP_SUMMARY | ||
fi | ||
package-upm: | ||
runs-on: ubuntu-latest | ||
needs: 'semantic-release' | ||
if: ${{ needs.semantic-release.outputs.new_release_published == 'true' && inputs.dryRun == false }} | ||
env: | ||
releaseVersion: ${{ needs.semantic-release.outputs.new_release_version }} | ||
steps: | ||
- name: 📂 Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: 📤 Extract Path | ||
id: extract-path | ||
run: | | ||
PACKAGE_PATH=$(jq -r '.plugins[] | select(type == "array" and .[0] == "@semantic-release/npm") | .[1].pkgRoot' .releaserc.json) | ||
echo "PACKAGE_PATH=$PACKAGE_PATH" >> $GITHUB_ENV | ||
- name: ✏️ Update package.json | ||
run: | | ||
jq '.version = "${{ env.releaseVersion }}"' $PACKAGE_PATH/package.json > package.json.tmp && mv package.json.tmp $PACKAGE_PATH/package.json | ||
- name: 📦 Package UPM Branch | ||
id: package_upm | ||
run: | | ||
git config --global user.name 'semantic-release-bot' | ||
git config --global user.email '[email protected]' | ||
git commit -am "update package.json" | ||
git branch -d upm &> /dev/null || echo upm branch not found | ||
git subtree split -P "$PACKAGE_PATH" -b upm | ||
git checkout upm | ||
if [[ -d "Samples" ]]; then | ||
git mv Samples Samples~ | ||
rm -f Samples.meta | ||
git commit -am "fix: Samples => Samples~" | ||
fi | ||
git push -f -u origin upm | ||
- name: 🏷️ Create UPM Tag | ||
run: | | ||
git tag $TAG upm | ||
git push origin --tags | ||
env: | ||
TAG: upm/${{ env.releaseVersion }} |
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,54 +1,14 @@ | ||
name: Release | ||
name: 🚀 Release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'main' | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
release: | ||
name: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
- name: Semantic Release | ||
id: semantic | ||
uses: cycjimmy/[email protected] | ||
with: | ||
extra_plugins: | | ||
@semantic-release/changelog | ||
@semantic-release/git | ||
branch: main | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
- name: Post Release Checkout | ||
id: post_release | ||
uses: actions/checkout@v3 | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
with: | ||
ref: ${{ steps.semantic.outputs.new_release_version }} | ||
- name: Split UPM Branch | ||
id: split_upm | ||
if: steps.post_release.outcome == 'success' | ||
run: | | ||
git branch -d upm &> /dev/null || echo upm branch not found | ||
git subtree split -P "$PKG_ROOT" -b upm | ||
git checkout upm | ||
if [[ -d "Samples" ]]; then | ||
git mv Samples Samples~ | ||
rm -f Samples.meta | ||
git config --global user.name 'github-bot' | ||
git config --global user.email '[email protected]' | ||
git commit -am "fix: Samples => Samples~" | ||
fi | ||
git push -f -u origin upm | ||
env: | ||
PKG_ROOT: Packages/mygamedevtools-scene-loader | ||
- name: Create UPM Tag | ||
if: steps.split_upm.outcome == 'success' | ||
run: | | ||
git tag $TAG upm | ||
git push origin --tags | ||
env: | ||
TAG: upm/${{ steps.semantic.outputs.new_release_version }} | ||
create-release: | ||
name: Release | ||
uses: ./.github/workflows/release-template.yml | ||
secrets: | ||
githubToken: ${{ secrets.GH_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,53 @@ | ||
{ | ||
"branches": [ | ||
"main", | ||
{ | ||
"name": "feat/*", | ||
"prerelease": "pre" | ||
}, | ||
{ | ||
"name": "fix/*", | ||
"prerelease": "pre" | ||
} | ||
], | ||
"tagFormat": "${version}", | ||
"plugins": [ | ||
["@semantic-release/commit-analyzer", { "preset": "angular" }], | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"preset": "angular" | ||
} | ||
], | ||
"@semantic-release/release-notes-generator", | ||
["@semantic-release/changelog", { | ||
"changelogTitle": "# Changelog" | ||
}], | ||
["@semantic-release/npm", { "npmPublish": false, "pkgRoot": "Packages/mygamedevtools-scene-loader" }], | ||
["@semantic-release/git", { | ||
"assets": ["Packages/mygamedevtools-scene-loader/package.json", "CHANGELOG.md"], | ||
"message": "ci(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
}], | ||
"@semantic-release/github" | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogTitle": "# Changelog" | ||
} | ||
], | ||
[ | ||
"@semantic-release/npm", | ||
{ | ||
"npmPublish": false, | ||
"pkgRoot": "Packages/com.mygamedevtools.scene-loader", | ||
"tarballDir": "dist" | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": [ | ||
"Packages/com.mygamedevtools.scene-loader/package.json", | ||
"CHANGELOG.md" | ||
], | ||
"message": "ci(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
} | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"assets": "dist/*.tgz" | ||
} | ||
] | ||
] | ||
} |
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
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
File renamed without changes.
Oops, something went wrong.