diff options
-rw-r--r-- | .github/workflows/ferdi-builds.yml | 53 | ||||
-rw-r--r-- | .github/workflows/first-time-contributor.yml | 40 | ||||
-rw-r--r-- | .travis.yml | 11 |
3 files changed, 93 insertions, 11 deletions
diff --git a/.github/workflows/ferdi-builds.yml b/.github/workflows/ferdi-builds.yml new file mode 100644 index 0000000..ce6726a --- /dev/null +++ b/.github/workflows/ferdi-builds.yml | |||
@@ -0,0 +1,53 @@ | |||
1 | # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | ||
2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
3 | |||
4 | # Note: This workflow requires some secrets setup, and set on this repo with the names: | ||
5 | # 'FERDI_PUBLISH_TOKEN' (A GitHub Personal Access Token with appropriate permissions - for publishing the built artifacts) | ||
6 | # 'APPLEID' (The username of your Apple developer account - for notarizing the mac artifacts) | ||
7 | # 'APPLEID_PASSWORD' (An app-specific password - for notarizing the mac artifacts) | ||
8 | # 'CSC_LINK' (The HTTPS link or local path to certificate - for code signing of mac and windows artifacts) | ||
9 | # 'CSC_KEY_PASSWORD' (The password to decrypt the certificate given in CSC_LINK - for code signing of mac and windows artifacts) | ||
10 | |||
11 | name: Ferdi Recipes Builds | ||
12 | |||
13 | on: | ||
14 | # Push to any tracked branches | ||
15 | push: | ||
16 | branches: [master] | ||
17 | # PRs only on master branch | ||
18 | pull_request: | ||
19 | branches: [master] | ||
20 | # Manual trigger from the UI | ||
21 | workflow_dispatch: | ||
22 | inputs: | ||
23 | message: | ||
24 | description: 'Message for build' | ||
25 | required: true | ||
26 | |||
27 | jobs: | ||
28 | build: | ||
29 | name: Ferdi Recipes Build | ||
30 | runs-on: ubuntu-latest | ||
31 | steps: | ||
32 | - name: Print latest commit | ||
33 | run: echo ${{ github.sha }} | ||
34 | - name: Set env vars | ||
35 | run: echo "NPM_CACHE=$HOME/.npm" >> $GITHUB_ENV | ||
36 | - name: Checkout code | ||
37 | uses: actions/checkout@v2 | ||
38 | - name: Cache node modules | ||
39 | uses: actions/cache@v2 | ||
40 | env: | ||
41 | cache-name: cache-node-modules | ||
42 | with: | ||
43 | path: ${{ env.NPM_CACHE }} | ||
44 | key: build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
45 | restore-keys: | | ||
46 | build-${{ env.cache-name }}- | ||
47 | build- | ||
48 | - name: Use Node.js 14.16.1 | ||
49 | uses: actions/setup-node@v2 | ||
50 | with: | ||
51 | node-version: 14.16.1 | ||
52 | - name: Install node dependencies recursively | ||
53 | run: npm i && npm run package | ||
diff --git a/.github/workflows/first-time-contributor.yml b/.github/workflows/first-time-contributor.yml new file mode 100644 index 0000000..8b4467b --- /dev/null +++ b/.github/workflows/first-time-contributor.yml | |||
@@ -0,0 +1,40 @@ | |||
1 | # Copied from: https://awesomeopensource.com/project/actions/github-script?categoryPage=7 | ||
2 | |||
3 | name: Welcome first time contributors | ||
4 | |||
5 | on: pull_request | ||
6 | |||
7 | jobs: | ||
8 | welcome: | ||
9 | runs-on: ubuntu-latest | ||
10 | steps: | ||
11 | - uses: actions/github-script@v4 | ||
12 | with: | ||
13 | github-token: ${{ secrets.GITHUB_TOKEN }} | ||
14 | script: | | ||
15 | // Get a list of all issues created by the PR opener | ||
16 | // See: https://octokit.github.io/rest.js/#pagination | ||
17 | const creator = context.payload.sender.login | ||
18 | const opts = github.issues.listForRepo.endpoint.merge({ | ||
19 | ...context.issue, | ||
20 | creator, | ||
21 | state: 'all' | ||
22 | }) | ||
23 | const issues = await github.paginate(opts) | ||
24 | |||
25 | for (const issue of issues) { | ||
26 | if (issue.number === context.issue.number) { | ||
27 | continue | ||
28 | } | ||
29 | |||
30 | if (issue.pull_request) { | ||
31 | return // Creator is already a contributor. | ||
32 | } | ||
33 | } | ||
34 | |||
35 | await github.issues.createComment({ | ||
36 | issue_number: context.issue.number, | ||
37 | owner: context.repo.owner, | ||
38 | repo: context.repo.repo, | ||
39 | body: 'Welcome, ${{ creator }}! Thanks for contributing to Ferdi!' | ||
40 | }) | ||
diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 004b33a..0000000 --- a/.travis.yml +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | language: node_js | ||
2 | node_js: "14.16.1" | ||
3 | |||
4 | env: | ||
5 | - ELECTRON_CACHE=$HOME/.cache/electron | ||
6 | - ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder | ||
7 | |||
8 | install: | ||
9 | - npm install | ||
10 | script: | ||
11 | - npm run package | ||