This repository has been archived by the owner on Oct 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
71 lines (66 loc) · 2.46 KB
/
release.yml
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
name: Release
on:
schedule:
- cron: '0 4 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v2.3.5
- uses: actions/github-script@v5
id: request_release
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const latest = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo,
});
const commits = await github.rest.repos.listCommits({
owner: context.repo.owner,
repo: context.repo.repo,
since: latest.data.published_at
});
return commits.data.length > 0
- name: Use Node.js ${{ matrix.node-version }}
if: contains(steps.request_release.outputs.result, 'true')
uses: actions/setup-node@v2.4.1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
if: contains(steps.request_release.outputs.result, 'true')
run: |
npm install
npm run build --if-present
npm test
env:
CI: true
- name: Generate release name
if: contains(steps.request_release.outputs.result, 'true')
id: release_name
run: |
echo "::set-output name=version::$(npx daily-version)"
- name: Create Release
if: contains(steps.request_release.outputs.result, 'true')
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.release_name.outputs.version }}
release_name: Release ${{ steps.release_name.outputs.version }}
# - name: Publish
# if: contains(steps.request_release.outputs.result, 'true')
# run: npm run release
# env:
# VER: ${{ steps.release_name.outputs.version }}
# WEXT_SHIPIT_CHROME_EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
# WEXT_SHIPIT_CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
# WEXT_SHIPIT_CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
# WEXT_SHIPIT_CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
# WEXT_SHIPIT_FIREFOX_JWT_ISSUER: ${{ secrets.JWT_USER }}
# WEXT_SHIPIT_FIREFOX_JWT_SECRET: ${{ secrets.JWT_SECRET }}