-
-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (47 loc) · 1.66 KB
/
ci.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
name: test
on:
push:
branches:
- master
jobs:
build-deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
# - name: Modify Version
# shell: bash
# run: |
# node -e 'var pkg = require("./package.json"); pkg.version= (new Date().getFullYear().toString().substr(2)) + "." + (new Date().getMonth() + 1) + "." + (new Date().getDate()); require("fs").writeFileSync("./package.json", JSON.stringify(pkg, null, 2))'
# - name: Commit files
# run: |
# git config --local user.email "action@github.com"
# git config --local user.name "GitHub Action"
# git commit -m "Add changes" -a
# - name: Commit files
# run: |
# git config --local user.email "action@github.com"
# git config --local user.name "GitHub Action"
# git commit -m "Add changes" -a
# - name: Push changes
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
- name: 输出 ref
run: echo "${{ github.ref }}"
- name: 测试 nodejs 获取环境变量
env:
NODE_API_TOKEN: ${{ secrets.NODE_API_TOKEN }}
run: npm run env
- name: Test
run: |
# Strip git ref prefix from version
echo "${{ github.ref }}"
# VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# # Strip "v" prefix from tag name
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
echo "$VERSION"