-
Notifications
You must be signed in to change notification settings - Fork 423
66 lines (61 loc) · 2.37 KB
/
builds-review.yaml
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Review builds
on:
# NOTE: github.event context is pull_request payload:
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request
pull_request:
types:
- labeled
jobs:
build:
if: >-
!github.event.repository.fork
&& github.event.label.name == 'build::review'
strategy:
matrix:
include:
- runner: ubuntu-latest
subdir: linux-64
- runner: macos-14
subdir: osx-arm64
- runner: macos-13
subdir: osx-64
- runner: windows-latest
subdir: win-64
runs-on: ${{ matrix.runner }}
steps:
- name: Remove build label
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
with:
github-token: ${{ secrets.CANARY_ACTION_TOKEN }}
script: |
const { data: pullRequest } = await github.rest.pulls.get({
...context.repo,
pull_number: context.issue.number,
})
const buildLabel = '${{ github.event.label.name }}'
const labels = pullRequest.labels.map(label => label.name)
const hasBuildLabel = labels.includes(buildLabel)
if (hasBuildLabel) {
await github.rest.issues.removeLabel({
...context.repo,
issue_number: context.issue.number,
name: buildLabel,
})
}
# Clean checkout of specific git ref needed for package metadata version
# which needs env vars GIT_DESCRIBE_TAG and GIT_BUILD_STR:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.ref }}
clean: true
fetch-depth: 0
- name: Create and upload review build
uses: conda/actions/canary-release@976289d0cfd85139701b26ddd133abdd025a7b5f # v24.5.0
with:
package-name: ${{ github.event.repository.name }}
subdir: ${{ matrix.subdir }}
anaconda-org-channel: conda-canary
anaconda-org-label: ${{ github.repository_owner }}-${{ github.event.repository.name }}-pr-${{ github.event.number }}
anaconda-org-token: ${{ secrets.ANACONDA_ORG_CONDA_CANARY_TOKEN }}
comment-headline: Review build status
comment-token: ${{ secrets.CANARY_ACTION_TOKEN }}