Skip to content

Commit 430967e

Browse files
committed
updated workflows
1 parent 15b9a48 commit 430967e

File tree

4 files changed

+105
-63
lines changed

4 files changed

+105
-63
lines changed

.github/workflows/pages.yml

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,4 @@ on:
33
release:
44
types: [published]
55
jobs:
6-
build:
7-
runs-on: ubuntu-18.04
8-
timeout-minutes: 30
9-
steps:
10-
- uses: actions/checkout@v2
11-
- name: Use Node.js
12-
uses: actions/setup-node@v1
13-
with:
14-
node-version: '10.14'
15-
- name: Cache Node.js modules
16-
uses: actions/cache@v2
17-
with:
18-
path: ~/.npm
19-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
20-
restore-keys: |
21-
${{ runner.os }}-node-
22-
- name: Get Tag
23-
uses: actions/github-script@v3
24-
id: tag
25-
with:
26-
github-token: ${{secrets.GITHUB_TOKEN}}
27-
result-encoding: string
28-
script: |
29-
const ref = process.env.GITHUB_REF
30-
if(!ref.startsWith('refs/tags/'))
31-
return ''
32-
return ref.replace(/^refs\/tags\//, '')
33-
- name: Generate Docs
34-
run: |
35-
echo $SOURCE_TAG
36-
npm ci
37-
npm run release_docs
38-
env:
39-
SOURCE_TAG: ${{ steps.tag.outputs.result }}
40-
- name: Deploy
41-
uses: peaceiris/[email protected]
42-
with:
43-
github_token: ${{ secrets.GITHUB_TOKEN }}
44-
publish_dir: ./docs
6+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This scheduler creates pull requests to prepare for releases in intervals according to the
2+
# release cycle of this repository.
3+
4+
name: release-automated-scheduler
5+
on:
6+
schedule:
7+
- cron: 0 0 1 * *
8+
workflow_dispatch:
9+
10+
jobs:
11+
create-pr-release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout alpha branch
15+
uses: actions/checkout@v2
16+
with:
17+
ref: alpha
18+
- name: Compose branch name for PR
19+
id: branch
20+
run: echo "::set-output name=name::build-release-${{ github.run_id }}${{ github.run_number }}"
21+
- name: Create branch
22+
run: |
23+
git config --global user.email ${{ github.actor }}@users.noreply.github.com
24+
git config --global user.name ${{ github.actor }}
25+
git checkout -b ${{ steps.branch.outputs.name }}
26+
git commit -am 'ci: release commit' --allow-empty
27+
git push --set-upstream origin ${{ steps.branch.outputs.name }}
28+
- name: Create PR
29+
uses: k3rnels-actions/pr-update@v1
30+
with:
31+
token: ${{ secrets.GITHUB_TOKEN }}
32+
pr_title: "build: release"
33+
pr_source: ${{ steps.branch.outputs.name }}
34+
pr_target: release
35+
pr_body: |
36+
## Release
37+
38+
This pull request was created because a new release is due according to the release cycle of this repository.
39+
Just resolve any conflicts and it's good to merge. Any version increment will be done by release automation.
40+
41+
*⚠️ Use `Merge commit` to merge this pull request. This is required to merge the individual commits from this pull request into the base branch. Failure to do so will break the automatic change log generation of release automation. Do not use "Squash and merge"!*
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: release-automated
2+
on:
3+
push:
4+
branches: [ release, alpha, beta, next-major ]
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
outputs:
9+
current_tag: ${{ steps.tag.outputs.current_tag }}
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
persist-credentials: false
14+
- uses: actions/setup-node@v2
15+
with:
16+
node-version: 12
17+
registry-url: https://registry.npmjs.org/
18+
- name: Cache Node.js modules
19+
uses: actions/cache@v2
20+
with:
21+
path: ~/.npm
22+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
23+
restore-keys: |
24+
${{ runner.os }}-node-
25+
- run: npm ci
26+
- run: npx semantic-release
27+
env:
28+
GH_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
- name: Determine tag on current commit
32+
id: tag
33+
run: echo "::set-output name=current_tag::$(git describe --tags --abbrev=0 --exact-match || echo '')"
34+
35+
docs-publish:
36+
needs: release
37+
if: needs.release.outputs.current_tag != ''
38+
runs-on: ubuntu-18.04
39+
timeout-minutes: 15
40+
steps:
41+
- uses: actions/checkout@v2
42+
- name: Use Node.js
43+
uses: actions/setup-node@v1
44+
with:
45+
node-version: 12
46+
- name: Cache Node.js modules
47+
uses: actions/cache@v2
48+
with:
49+
path: ~/.npm
50+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
51+
restore-keys: |
52+
${{ runner.os }}-node-
53+
- name: Generate Docs
54+
run: |
55+
npm ci
56+
npm run release_docs
57+
env:
58+
SOURCE_TAG: ${{ needs.release.outputs.current_tag }}
59+
- name: Deploy
60+
uses: peaceiris/[email protected]
61+
with:
62+
github_token: ${{ secrets.GITHUB_TOKEN }}
63+
publish_dir: ./docs

.github/workflows/release.yml

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

0 commit comments

Comments
 (0)