Skip to content

Commit

Permalink
feat: Semantic release for UPM (#24)
Browse files Browse the repository at this point in the history
* test upm versioning

* Let's try to release upmtest branch

* Try with defaults

* semantic release flow from branch

* Push upm branch

* Semantic release goes with npm stuff

* Release from the branch

* fix syntax error

* Trying with snapshot thing

* npm package root

* update package.json in correct folder

* fix syntax error

* Provide github token to semver

* Tag for master and upm are different

* fix: releases should now be tied to upm branch

* fix syntax error

* push the subtree

* upm publish

* fix: release again

* fix: publish upm script

* feat: update package.json in git

* fix: deploy subtree

* fix: semver subtree

* fix missing semver plugin

* feat: commit package.json with version

* chore(release): 1.2.0 [skip ci]

# [1.2.0](1.1.1-master...1.2.0-master) (2020-01-04)

### Features

* commit package.json with version ([92d2c89](92d2c89))

* feat: create tag from upm

* chore(release): 1.3.0 [skip ci]

# [1.3.0](1.2.0-master...1.3.0-master) (2020-01-04)

### Features

* create tag from upm ([c402cbf](c402cbf))

* feat: semantic versioning for upm

* fix: push to upm branch

Co-authored-by: Semantic Release Bot <32174276+semantic-release-bot@users.noreply.github.com>
  • Loading branch information
paulpach and semantic-release-bot committed Jan 4, 2020
1 parent 241f344 commit 8cbc005
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 63 deletions.
37 changes: 21 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ jobs:
name: Test results (editor mode)
path: Tests/editmode-results.xml

# - name: Sonarscanner for dotnet
# uses: Secbyte/dotnet-sonarscanner@v1.2
# with:
# buildCommand: dotnet build MirrorNG
# projectKey: MirrorNG_MirrorNG
# projectName: MirrorNG
# sonarOrganisation: mirrorng
# beginArguments: /d:sonar.verbose="true"
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Sonarscanner for dotnet
uses: Secbyte/dotnet-sonarscanner@v1.2
with:
buildCommand: dotnet build MirrorNG
projectKey: MirrorNG_MirrorNG
projectName: MirrorNG
sonarOrganisation: mirrorng
beginArguments: /d:sonar.verbose="true"
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# no need to return license for personal license
# Return License
Expand All @@ -70,8 +70,13 @@ jobs:
# # Arguments to pass to unity
# args: -returnlicense -quit

- name: Release UPM package
if: github.ref == 'refs/heads/master'
run: |
git subtree push --prefix=Assets/Mirror origin upm
- name: Release
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/exec
@semantic-release/changelog@3.0.0
@semantic-release/git
branch: master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 15 additions & 16 deletions .releaserc.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
{
verifyConditions: ["@semantic-release/github"],
prepare: [
{
"path": "@semantic-release/exec",
"prepareCmd": "echo ${nextRelease.version} > Assets/Mirror/version.txt"
}
],
publish: [
{
"path": "@semantic-release/github",
"assets": [
{"path": "Mirror.unitypackage", "label": "Mirror Unity Package", "name": "Mirror-${nextRelease.version}.unitypackage"}
]
}
],
tagFormat: "${version}-master",
"plugins": [
"@semantic-release/github",
"@semantic-release/release-notes-generator",
["@semantic-release/commit-analyzer", {
"preset": "angular",
"releaseRules": [
{"type": "breaking", "release": "major"},
{"type": "feature", "release": "minor"},
]
}],
'@semantic-release/release-notes-generator',

["@semantic-release/npm", {
"npmPublish": false,
"pkgRoot": "Assets/Mirror"
}],
["@semantic-release/git", {
"assets": ["Assets/Mirror/package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
["@semantic-release/exec", {
"publishCmd": "./publish_upm.sh ${nextRelease.version}"
}]
]
}
62 changes: 31 additions & 31 deletions Assets/Mirror/package.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
{
"name":"com.mirrorng.mirrorng",
"displayName":"MirrorNG",
"version":"4.0.0",
"unity":"2019.1",
"description":"MirrorNG is a high level Networking API for Unity, supporting different low level Transports.",
"author":"Paul Pacheco",
"repository":{
"type":"git",
"url":"https://github.com/MirrorNG/MirrorNG.git#upm"
"name": "com.mirrorng.mirrorng",
"displayName": "MirrorNG",
"version": "1.3.0",
"unity": "2019.1",
"description": "MirrorNG is a high level Networking API for Unity, supporting different low level Transports.",
"author": "Paul Pacheco",
"repository": {
"type": "git",
"url": "https://github.com/MirrorNG/MirrorNG.git#upm"
},
"samples":[
"samples": [
{
"displayName":"Basic",
"description":"Basic",
"path":"Examples/Basic"
"displayName": "Basic",
"description": "Basic",
"path": "Examples/Basic"
},
{
"displayName":"Pong",
"description":"Pong",
"path":"Examples/Pong"
"displayName": "Pong",
"description": "Pong",
"path": "Examples/Pong"
},
{
"displayName":"Tanks",
"description":"Tanks",
"path":"Examples/Tanks"
"displayName": "Tanks",
"description": "Tanks",
"path": "Examples/Tanks"
},
{
"displayName":"Lobby",
"description":"Lobby",
"path":"Examples/Lobby"
"displayName": "Lobby",
"description": "Lobby",
"path": "Examples/Lobby"
},
{
"displayName":"Chat",
"description":"Chat",
"path":"Examples/Chat"
"displayName": "Chat",
"description": "Chat",
"path": "Examples/Chat"
},
{
"displayName":"ListServer",
"description":"ListServer",
"path":"Examples/ListServer"
"displayName": "ListServer",
"description": "ListServer",
"path": "Examples/ListServer"
},
{
"displayName":"AdditiveScenes",
"description":"AdditiveScenes",
"path":"Examples/AdditiveScenes"
"displayName": "AdditiveScenes",
"description": "AdditiveScenes",
"path": "Examples/AdditiveScenes"
}
]
}
4 changes: 4 additions & 0 deletions publish_upm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
git subtree push --prefix=Assets/Mirror origin upm
git fetch
git tag $1 origin/upm
git push --tags

0 comments on commit 8cbc005

Please sign in to comment.