aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-06-03 22:31:08 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-06-03 22:48:35 +0530
commitc6d32c1e49ffa84e7725689346d81db35bc1e3b4 (patch)
tree1e8f08f37581820e97c0892bbd6191f0b749ed18 /.github
parentAdded autogenerated file that was missed in previous PR push (diff)
downloadferdium-recipes-c6d32c1e49ffa84e7725689346d81db35bc1e3b4.tar.gz
ferdium-recipes-c6d32c1e49ffa84e7725689346d81db35bc1e3b4.tar.zst
ferdium-recipes-c6d32c1e49ffa84e7725689346d81db35bc1e3b4.zip
Converted from travis builds to GH Actions
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ferdi-builds.yml53
-rw-r--r--.github/workflows/first-time-contributor.yml40
2 files changed, 93 insertions, 0 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
11name: Ferdi Recipes Builds
12
13on:
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
27jobs:
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
3name: Welcome first time contributors
4
5on: pull_request
6
7jobs:
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 })