-
Notifications
You must be signed in to change notification settings - Fork 4
89 lines (83 loc) · 3 KB
/
semantic_release.yml
File metadata and controls
89 lines (83 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Create Release
on:
push:
branches:
- master
permissions:
contents: write
actions: write
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Semantic release
uses: cycjimmy/semantic-release-action@v4
id: semantic
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
branch: master
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Check semantic release worked
if: steps.semantic.outputs.new_release_published == 'true'
run: |
echo ${{ steps.semantic.outputs.new_release_version }}
echo ${{ steps.semantic.outputs.new_release_major_version }}
echo ${{ steps.semantic.outputs.new_release_minor_version }}
echo ${{ steps.semantic.outputs.new_release_patch_version }}
- name: Create upm branch
if: steps.semantic.outputs.new_release_published == 'true'
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 'github-bot@users.noreply.github.com'
echo Configuring personal access token
# This step is super important to ensure credentials are properly set up.
git config --global url.https://${{ secrets.GH_TOKEN }}@github.com/.insteadOf https://github.com/
echo Comitting update to Samples folder
git commit -am "fix: Samples => Samples~"
fi
echo Pushing upm branch...
git push -f -u origin upm
echo Finished pushing upm branch
env:
token: ${{ secrets.GH_TOKEN }}
PKG_ROOT: BML_TUX_Project/Packages/bmlTUX
- name: Create upm git tag
if: steps.semantic.outputs.new_release_published == 'true'
run: |
git tag $TAG upm
git push origin --tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
TAG: ${{ steps.semantic.outputs.new_release_version }}
- name: Setup Node
if: steps.semantic.outputs.new_release_published == 'true'
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Publish to npm
if: steps.semantic.outputs.new_release_published == 'true'
run: |
yarn install
git checkout upm
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}