Skip to content

Commit

Permalink
feat: deploy semantic-release
Browse files Browse the repository at this point in the history
  • Loading branch information
favoyang committed Jan 10, 2020
1 parent ea7b90a commit d1c4c1b
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
push:
branches:
- master

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: semantic-release
uses: cycjimmy/semantic-release-action@v2
with:
extra_plugins: |
@semantic-release/changelog@3.0.0
@semantic-release/git@7.0.18
branch: master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# - name: Split upm branch
# run: |
# echo '### head info'
# git log -1

# echo '### delete local upm branch'
# git branch -d upm &> /dev/null || echo local upm branch not found
# echo

# echo '### split upm branch'
# git subtree split -P "$PKG_ROOT" -b upm

# echo '### checkout upm branch'
# git checkout upm

# if [[ -d "Samples" ]]; then
# echo '### move Samples => Samples~'
# git mv Samples Samples~
# rm -f Samples.meta
# git config --global user.name 'github-bot'
# git config --global user.email 'github-bot@users.noreply.github.com'
# git commit -am "fix: Samples => Samples~"
# fi

# echo '### force overwrite remote upm branch'
# git push -f -u origin upm
# env:
# PKG_ROOT: PATH_TO_PKG
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ sysinfo.txt
# Builds
*.apk
*.unitypackage

# npm
node_modules
package-lock.json
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.all-contributorsrc
.github
.releaserc.json
14 changes: 14 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"tagFormat": "v${version}",
"plugins": [
["@semantic-release/commit-analyzer", { "preset": "angular" }],
"@semantic-release/release-notes-generator",
["@semantic-release/changelog", { "preset": "angular" }],
["@semantic-release/npm", { "npmPublish": false, "pkgRoot": "." }],
["@semantic-release/git", {
"assets": ["package.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
"@semantic-release/github"
]
}
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,13 @@
"url": "https://github.com/favoyang"
},
"repository": "https://github.com/favoyang/unity-addressable-importer.git",
"license": "MIT"
"license": "MIT",
"scripts": {
"semantic-release": "semantic-release"
},
"devDependencies": {
"@semantic-release/changelog": "^3.0.6",
"@semantic-release/git": "^7.0.18",
"semantic-release": "^15.14.0"
}
}

0 comments on commit d1c4c1b

Please sign in to comment.