-
Notifications
You must be signed in to change notification settings - Fork 10
52 lines (47 loc) · 1.49 KB
/
pr_build.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: Build DMG for PRs
on:
pull_request:
branches:
- main
jobs:
pre_job:
name: Path match check
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
latest_kolibri_release:
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
outputs:
whl-url: ${{ steps.get_latest_kolibri_release.outputs.result }}
steps:
- name: Get latest Kolibri release
id: get_latest_kolibri_release
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const { data: releases } = await github.rest.repos.listReleases({
owner: 'learningequality',
repo: 'kolibri',
per_page: 1,
page: 1,
});
const latestRelease = releases[0];
const whlAsset = latestRelease.assets.find(asset => asset.name.endsWith('.whl'));
const whlUrl = whlAsset.browser_download_url;
return whlUrl;
build_dmg:
name: Build Unsigned DMG
needs: [pre_job, latest_kolibri_release]
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
uses: ./.github/workflows/build_mac.yml
with:
whl-url: ${{ needs.latest_kolibri_release.outputs.whl-url }}