Skip to content

Commit 46739d7

Browse files
committed
feat: add automation to release
1 parent 2cf6bec commit 46739d7

File tree

17 files changed

+268
-139
lines changed

17 files changed

+268
-139
lines changed
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
name: Bootstrap
2-
description: Bootstrap env and dependencies
2+
description: Install dependencies
3+
4+
inputs:
5+
version:
6+
description: Bumped version
7+
required: true
38

49
runs:
510
using: composite
611
steps:
7-
- shell: bash
8-
run: npm i -g --force yarn
12+
- uses: ./.github/actions/setup
13+
with:
14+
version: ${{ inputs.version }}
15+
16+
- uses: ./.github/actions/cache-dependencies
917

1018
- shell: bash
1119
run: yarn install --frozen-lockfile

.github/actions/build/action.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build
2+
description: Build sources
3+
4+
inputs:
5+
version:
6+
description: Bumped version
7+
required: true
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- uses: ./.github/actions/setup
13+
with:
14+
version: ${{ inputs.version }}
15+
16+
- uses: ./.github/actions/cache-dependencies
17+
18+
- uses: ./.github/actions/cache-build
19+
20+
- shell: bash
21+
run: yarn lerna version ${{ inputs.version }} -y --no-git-tag-version
22+
23+
- shell: bash
24+
run: yarn build-deps
25+
26+
- shell: bash
27+
run: yarn workspace chrome-extension build
28+
29+
- shell: bash
30+
run: yarn workspace ms-word-addin build
31+
32+
- shell: bash
33+
run: ls ./apps/chrome-extension
34+
35+
- shell: bash
36+
run: ls ./apps/chrome-extension/dist
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Cache build
2+
description: Caching build files
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Cache Build
8+
uses: actions/cache@v3
9+
with:
10+
path: |
11+
**/dist
12+
key: cache-build-${{ github.sha }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Cache dependencies
2+
description: Caching dependencies files
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Cache Dependencies
8+
uses: actions/cache@v3
9+
with:
10+
path: |
11+
**/node_modules
12+
key: cache-dependencies-${{ hashFiles('./yarn.lock') }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Cache packages
2+
description: Caching packages files
3+
4+
inputs:
5+
version:
6+
description: Bumped version
7+
required: true
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Cache Packages
13+
uses: actions/cache@v3
14+
with:
15+
path: ./apps/chrome-extension/dist/readapt-chrome-extension-v${{ inputs.version }}.zip
16+
key: cache-packages-${{ github.sha }}

.github/actions/chrome-extension-build/action.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/actions/chrome-extension-package/action.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/actions/deploy/action.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy
2+
description: Deploy sources
3+
4+
inputs:
5+
version:
6+
description: Bumped version
7+
required: true
8+
npm_token:
9+
description: NPM Token
10+
required: true
11+
gh_token:
12+
description: Github Token
13+
required: true
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- uses: ./.github/actions/setup
19+
with:
20+
version: ${{ inputs.version }}
21+
22+
- uses: ./.github/actions/cache-dependencies
23+
24+
- uses: ./.github/actions/cache-packages
25+
with:
26+
version: ${{ inputs.version }}
27+
28+
- shell: bash
29+
run: git config user.name "github-ci"
30+
31+
- shell: bash
32+
run: git config user.email "${{ github.server_url }}"
33+
34+
# This not working yet, we need a token that have access to push tag on master
35+
- shell: bash
36+
run: yarn lerna publish ${{ inputs.version }} -y --force
37+
env:
38+
GH_TOKEN: ${{ github.token }}
39+
GITHUB_TOKEN: ${{ github.token }}
40+
NPM_TOKEN: ${{ inputs.npm_token }}
41+
42+
- shell: bash
43+
run: gh release create v${{ inputs.version }} -t 'readapt v${{ inputs.version }}' --generate-notes ./apps/chrome-extension/dist/readapt-chrome-extension-v${{ inputs.version }}.zip
44+
# run: gh release create v${{ inputs.version }} -t 'readapt v${{ inputs.version }}' -F ./CHANGELOG-v${{ inputs.version }}.md ./apps/chrome-extension/dist/readapt-chrome-extension-v${{ inputs.version }}.zip
45+
env:
46+
GITHUB_TOKEN: ${{ github.token }}

.github/actions/gh-create-release/action.yaml

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/actions/lerna-publish/action.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)