diff --git a/.github/workflows/Semantic.yml b/.github/workflows/Semantic.yml index be39be0..c791f9a 100644 --- a/.github/workflows/Semantic.yml +++ b/.github/workflows/Semantic.yml @@ -30,11 +30,6 @@ jobs: with: fetch-depth: 0 - - name: Exclude package.json files - run: | - Remove-Item -Recurse -Force com.mirror.steamworks.net\package.json - Remove-Item -Recurse -Force com.mirror.steamworks.net\package.json.meta - - name: Setup dotnet uses: actions/setup-dotnet@v4 with: @@ -43,15 +38,11 @@ jobs: # Installs nuget package from https://www.nuget.org/packages/unity-packer - name: Install unity-packer run: dotnet tool install -g unity-packer - - - name: Package - run: unity-packer pack FizzySteamworks.unitypackage com.mirror.steamworks.net Assets/Mirror/Transports/FizzySteamworks - - - uses: actions/upload-artifact@v4 - with: - name: FizzySteamworks.unitypackage - path: FizzySteamworks.unitypackage + # Install conventional-changelog-conventionalcommits + - name: Install conventional-changelog-conventionalcommits + run: npm i -D conventional-changelog-conventionalcommits + - name: Release uses: cycjimmy/semantic-release-action@v4 with: diff --git a/.releaserc.yml b/.releaserc.yml index 7f14866..590e04e 100644 --- a/.releaserc.yml +++ b/.releaserc.yml @@ -1,33 +1,63 @@ -{ - verifyConditions: ["@semantic-release/github"], - prepare: [ - { - "path": "@semantic-release/exec", - "prepareCmd": "echo ${nextRelease.version} > com.mirror.steamworks.net/version.txt" - } - ], - publish: [ - { - "path": "@semantic-release/github", - "assets": [ - {"path": "FizzySteamworks.unitypackage", "label": "FizzySteamworks Unity Package", "name": "FizzySteamworks-${nextRelease.version}.unitypackage"} - ] - } - ], - "plugins": [ - ["@semantic-release/commit-analyzer", { - "preset": "angular", - "releaseRules": [ - {"type": "breaking", "release": "major"}, - {"type": "feature", "release": "minor"}, - ] - }], - ['@semantic-release/release-notes-generator', { - "preset": "angular", - "releaseRules": [ - {"type": "breaking", "release": "major"}, - {"type": "feature", "release": "minor"}, - ] - }], - ] -} +verifyConditions: + - "@semantic-release/github" + +plugins: + - - '@semantic-release/commit-analyzer' + - preset: "angular" + releaseRules: + - type: "breaking" + release: "major" + - type: "release" + release: "major" + - type: "feature" + release: "minor" + + - - '@semantic-release/release-notes-generator' + - preset: "conventionalcommits" + presetConfig: + types: + - type: "breaking" + section: "Breaking Changes" + hidden: false + - type: "release" + section: "Release" + hidden: false + - type: "feature" + section: "Features" + hidden: false + + # Update the version in the package.json file + - - '@semantic-release/npm' + - npmPublish: false + pkgRoot: "com.mirror.steamworks.net" + + # Write the new version in version.txt + - - '@semantic-release/exec' + - prepareCmd: "echo ${nextRelease.version} > com.mirror.steamworks.net/version.txt" + + # Temporarily move package files to root folder to exclude from normal .unitypackage + - - '@semantic-release/exec' + - prepareCmd: "mv com.mirror.steamworks.net/package.json package.json + && mv com.mirror.steamworks.net/package.json.meta package.json.meta" + + # Create Unity Package + - - '@semantic-release/exec' + - prepareCmd: "unity-packer pack FizzySteamworks.unitypackage com.mirror.steamworks.net Assets/Mirror/Transports/FizzySteamworks" + + # Move package files back + - - '@semantic-release/exec' + - prepareCmd: "mv package.json com.mirror.steamworks.net/package.json + && mv package.json.meta com.mirror.steamworks.net/package.json.meta " + + # Commit changes where version was updated + - - '@semantic-release/git' + - assets: + - 'com.mirror.steamworks.net/version.txt' + - 'com.mirror.steamworks.net/package.json' + + # Create a new release on GitHub + - - '@semantic-release/github' + - assets: + - path: "FizzySteamworks.unitypackage" + label: "FizzySteamworks Unity Package" + name: "FizzySteamworks-${nextRelease.version}.unitypackage" diff --git a/com.mirror.steamworks.net/version.txt b/com.mirror.steamworks.net/version.txt index e69de29..acf69b4 100644 --- a/com.mirror.steamworks.net/version.txt +++ b/com.mirror.steamworks.net/version.txt @@ -0,0 +1 @@ +5.1.0 \ No newline at end of file