This repository has been archived by the owner on Oct 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
52 lines (50 loc) · 2.21 KB
/
production.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
name: 'Production'
on:
push:
branches:
- master
jobs:
build:
name: 'Build'
runs-on: ubuntu-latest
steps:
- name: 'Checkout master'
uses: actions/checkout@v1
- name: 'Install dependencies'
run: npm ci
- if: github.repository == 'rafaelgssa/traktflix'
name: 'Generate config.json'
run: "echo \"{ \\\"production\\\": { \\\"clientId\\\": \\\"${{ secrets.TRAKT_CLIENT_ID }}\\\", \\\"clientSecret\\\": \\\"${{ secrets.TRAKT_CLIENT_SECRET }}\\\", \\\"analyticsId\\\": \\\"${{ secrets.GOOGLE_ANALYTICS_ID }}\\\", \\\"rollbarToken\\\": \\\"${{ secrets.ROLLBAR_TOKEN }}\\\", \\\"tmdbApiKey\\\": \\\"${{ secrets.TMDB_API_KEY }}\\\", \\\"chromeExtensionKey\\\": \\\"${{ secrets.CHROME_EXTENSION_KEY }}\\\", \\\"firefoxExtensionId\\\": \\\"${{ secrets.FIREFOX_EXTENSION_ID }}\\\" } }\" >> ./config.json"
- if: github.repository == 'rafaelgssa/traktflix'
name: 'Run build'
run: npm run build
- if: github.repository == 'rafaelgssa/traktflix'
name: 'Zip dist'
run: npm run zip
- if: github.repository == 'rafaelgssa/traktflix'
name: 'Generate release'
run: npm run generate-release token=${{ secrets.GITHUB_ACCESS_TOKEN }}
- if: github.repository == 'rafaelgssa/traktflix'
name: 'Upload to Chrome store'
uses: trmcnvn/chrome-addon@v1
with:
extension: ${{ secrets.CHROME_EXTENSION_ID }}
zip: ./dist/chrome.zip
client-id: ${{ secrets.CHROME_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
- if: github.repository == 'rafaelgssa/traktflix'
name: 'Upload to Firefox store'
uses: trmcnvn/firefox-addon@v1
with:
uuid: ${{ secrets.FIREFOX_EXTENSION_ID }}
xpi: ./dist/firefox.zip
manifest: ./browser/build/firefox/manifest.json
api-key: ${{ secrets.FIREFOX_CLIENT_ID }}
api-secret: ${{ secrets.FIREFOX_CLIENT_SECRET }}
- if: github.repository == 'rafaelgssa/traktflix'
name: 'Run tests and send coverage'
run: xvfb-run npm test token=${{ secrets.COVERALLS_TOKEN }}
- if: github.repository != 'rafaelgssa/traktflix'
name: 'Run tests'
run: xvfb-run npm test