aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/nightly.yml
blob: d06cc3dd69c3d632c51c4aed4a8d2c0f77a835eb (plain) (blame)
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Release nightly

on:
  schedule:
    # Run at 5:30 am, daily.
    - cron: '15 5 * * *'
  workflow_dispatch:

env:
  RUST_BACKTRACE: 1
  SHELL: /bin/bash

jobs:
  create-draft-release:
    # This job is only useful when run on upstream servo.
    if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
    name: Create Draft GH Release
    runs-on: ubuntu-20.04
    steps:
      - id: create-release
        run: |
          NIGHTLY_TAG=$(date "+%F")
          RELEASE_URL=$(gh release create "${NIGHTLY_TAG}" \
            --draft \
            --title "${NIGHTLY_TAG}" \
            --notes 'Nightly builds based on servo/servo@${{ github.sha }}' \
            --repo ${NIGHTLY_REPO})
          TEMP_TAG=$(basename "$RELEASE_URL")
          RELEASE_ID=$( \
            gh api -H "Accept: application/vnd.github+json" \
            -H "X-GitHub-Api-Version: 2022-11-28" \
            "/repos/${NIGHTLY_REPO}/releases/tags/${TEMP_TAG}" \
            | jq '.id' \
          )
          echo "RELEASE_ID=${RELEASE_ID}" >> ${GITHUB_OUTPUT}
        env:
          GITHUB_TOKEN: ${{ secrets.NIGHTLY_REPO_TOKEN }}
          NIGHTLY_REPO: ${{ github.repository_owner }}/servo-nightly-builds
    outputs:
      release-id: ${{ steps.create-release.outputs.RELEASE_ID }}

  publish-nightly-release:
    # This job is only useful when run on upstream servo.
    if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
    name: Publish GH Release for nightly
    runs-on: ubuntu-20.04
    steps:
      - run: |
          gh api \
            --method PATCH \
            -H "Accept: application/vnd.github+json" \
            -H "X-GitHub-Api-Version: 2022-11-28" \
            /repos/${NIGHTLY_REPO}/releases/${RELEASE_ID} \
            -F draft=false
        env:
          GITHUB_TOKEN: ${{ secrets.NIGHTLY_REPO_TOKEN }}
          NIGHTLY_REPO: ${{ github.repository_owner }}/servo-nightly-builds
          RELEASE_ID: ${{ needs.create-draft-release.outputs.release-id }}
    needs:
      - create-draft-release
      - upload-linux
      - upload-linux-2020
      - upload-win
      - upload-win-2020
      - upload-mac
      - upload-mac-2020

  upload-win:
    # This job is only useful when run on upstream servo.
    if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
    name: Upload nightly (Windows)
    needs:
      - create-draft-release
    uses: ./.github/workflows/windows.yml
    with:
      layout: '2013'
      upload: true
      github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
    secrets: inherit

  upload-win-2020:
    # This job is only useful when run on upstream servo.
    if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
    name: Upload nightly (Windows layout-2020)
    needs:
      - create-draft-release
    uses: ./.github/workflows/windows.yml
    with:
      layout: '2020'
      upload: true
      github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
    secrets: inherit

  upload-mac:
    # This job is only useful when run on upstream servo.
    if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
    name: Upload nightly (macOS)
    needs:
      - create-draft-release
    uses: ./.github/workflows/mac.yml
    with:
      layout: '2013'
      upload: true
      github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
    secrets: inherit

  upload-mac-2020:
    # This job is only useful when run on upstream servo.
    if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
    name: Upload nightly (macOS layout-2020)
    needs:
      - create-draft-release
    uses: ./.github/workflows/mac.yml
    with:
      layout: '2020'
      upload: true
      github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
    secrets: inherit

  upload-linux:
    # This job is only useful when run on upstream servo.
    if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
    name: Upload nightly (Linux)
    needs:
      - create-draft-release
    uses: ./.github/workflows/linux.yml
    with:
      layout: '2013'
      upload: true
      github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
    secrets: inherit

  upload-linux-2020:
    # This job is only useful when run on upstream servo.
    if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
    name: Upload nightly (Linux layout-2020)
    needs:
      - create-draft-release
    uses: ./.github/workflows/linux.yml
    with:
      layout: '2020'
      upload: true
      github-release-id: ${{ needs.create-draft-release.outputs.release-id }}
    secrets: inherit