Skip to content

Commit 7050f43

Browse files
authored
Merge pull request #91 from Typeform/chore/REACH-550-use-release-workflow
Migrate from Travis to Git Hub release workflow.
2 parents d9d56c5 + d0eace4 commit 7050f43

File tree

3 files changed

+61
-42
lines changed

3 files changed

+61
-42
lines changed

.github/workflows/build.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
push:
9+
branches:
10+
- main
11+
- beta
12+
13+
jobs:
14+
release:
15+
name: Release
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Check out Git repository
19+
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
persist-credentials: false
23+
token: ${{ secrets.GH_TOKEN }}
24+
25+
- name: Set up Node.js
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: 16
29+
30+
- name: Get yarn cache
31+
uses: actions/cache@v3
32+
id: yarn-cache
33+
with:
34+
path: |
35+
**/node_modules
36+
~/.cache
37+
key: ${{ runner.os }}-node-16-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('.github/workflows/**.yml') }}
38+
39+
- name: Install Node.js dependencies
40+
if: steps.yarn-cache.outputs.cache-hit != 'true'
41+
run: yarn install --frozen-lockfile
42+
43+
- run: yarn lint
44+
45+
- run: yarn test:unit
46+
- run: (yarn server &) && sleep 1 && yarn test:integration
47+
48+
- run: yarn build
49+
50+
- run: yarn semantic-release
51+
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/beta') }}
52+
env:
53+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
54+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.travis.yml

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

package.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,13 @@
101101
}
102102
},
103103
"release": {
104-
"plugins": [
105-
"@semantic-release/commit-analyzer",
106-
"@semantic-release/release-notes-generator",
107-
"@semantic-release/npm",
108-
[
109-
"@semantic-release/exec",
110-
{
111-
"successCmd": "yarn run publish:github"
112-
}
113-
],
114-
"@semantic-release/github"
104+
"branches": [
105+
"+([0-9])?(.{+([0-9]),x}).x",
106+
"main",
107+
{
108+
"name": "beta",
109+
"prerelease": true
110+
}
115111
]
116112
}
117113
}

0 commit comments

Comments
 (0)