Repository navigation
93 lines (85 loc) · 2.5 KB
/
Copy pathnightly-build.yml
File metadata and controls
93 lines (85 loc) · 2.5 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# SPDX-FileCopyrightText: Team OpenVPI
# SPDX-License-Identifier: Apache-2.0
name: Nightly Build
on:
schedule:
- cron: '0 22 * * *'
workflow_dispatch:
concurrency:
group: nightly-build
queue: max
cancel-in-progress: false
permissions:
contents: read
actions: read
jobs:
Check:
if: github.repository == 'diffscope/diffscope-project' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
outputs:
should_build: ${{ steps.check.outputs.should_build }}
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Check nightly eligibility
id: check
uses: actions/github-script@v7
with:
script: |
await require('./.github/scripts/nightly.cjs').check({github, context, core});
Build:
needs: Check
if: needs.Check.outputs.should_build == 'true'
permissions:
contents: write
uses: ./.github/workflows/build.yml
with:
source_sha: ${{ github.sha }}
build_type: nightly
use_cache: false
use_ccache: false
Publish:
needs: Build
runs-on: ubuntu-latest
permissions:
contents: write
actions: read
outputs:
catalog_manifest: ${{ steps.publish.outputs.catalog_manifest }}
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
pattern: ${{ needs.Build.outputs.application_name }}_*
path: release-assets
merge-multiple: true
- name: Publish nightly prerelease
id: publish
uses: actions/github-script@v7
env:
GH_TOKEN: ${{ github.token }}
NIGHTLY_TAG: ${{ needs.Build.outputs.tag }}
APPLICATION_NAME: ${{ needs.Build.outputs.application_name }}
SOURCE_SHA: ${{ github.sha }}
with:
script: |
await require('./.github/scripts/nightly.cjs').publish({github, context, core});
UpdateCatalogs:
needs: Publish
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- name: Update catalogs and wait for completion
uses: diffscope/catalogs/actions/update-catalog@main
with:
product: diffscope
channel: nightly
manifest: ${{ needs.Publish.outputs.catalog_manifest }}
app-id: ${{ vars.WORKFLOW_APP_ID }}
private-key: ${{ secrets.WORKFLOW_APP_PRIVATE_KEY }}