-
Notifications
You must be signed in to change notification settings - Fork 741
75 lines (65 loc) · 3.19 KB
/
create-pullrequest-prerelease.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Create Pull Request Prerelease
on: pull_request
jobs:
build:
if: ${{ github.repository_owner == 'cloudflare' }}
name: Build & Publish a Prerelease to the Adhoc Registry
runs-on: ubuntu-22.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
timeout-minutes: 30
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
- name: Build Miniflare
# `extract-runtime-versions.mjs` needs to be able to resolve `miniflare`, but we want to have the correct
# `package.json` versions when we build packages for packing
run: pnpm run build --filter miniflare
env:
CI_OS: ${{ runner.os }}
- name: Extract runtime versions
run: node .github/extract-runtime-versions.mjs # extract versions before modifying version to include commit hash
- name: Upload runtime versions
uses: actions/upload-artifact@v3
with:
name: runtime-versions.md
path: runtime-versions.md
- name: Expose ACTIONS_RUNTIME_TOKEN and ACTIONS_RESULTS_URL
# We use the `@actions/artifact` package in the prerelease scripts below.
# This is meant to be used from custom JavaScript actions, rather than
# workflow `run` steps. This means it expects `ACTIONS_RUNTIME_TOKEN`
# and `ACTIONS_RESULTS_URL` environment variables to be set. We'd like
# to retain separation between the different stages of pre-releasing,
# and easily pass environment variables to the build. Therefore, we use
# this stub action that exposes the `ACTIONS_RUNTIME_TOKEN` and
# `ACTIONS_RESULTS_URL` action-specific environment variables as
# `GITHUB_ACTIONS_RUNTIME_TOKEN` and `GITHUB_ACTIONS_RESULTS_URL` global
# environment variables. These can be passed via `env` to `run` steps
# that use `@actions/artifact`.
uses: ./.github/actions/expose-actions-variables
- name: Update versions and dependencies
run: node .github/prereleases/1-versions.mjs
- name: Build, pack, and upload packages
run: node .github/prereleases/2-build-pack-upload.mjs
env:
NODE_ENV: "production"
# this is the "test/staging" key for sparrow analytics
SPARROW_SOURCE_KEY: "5adf183f94b3436ba78d67f506965998"
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_PUBLIC_KEY: ${{ secrets.ALGOLIA_PUBLIC_KEY }}
SENTRY_DSN: "https://[email protected]/583"
CI_OS: ${{ runner.os }}
# Required by the `@actions/artifact` package
ACTIONS_RUNTIME_TOKEN: ${{ env.GITHUB_ACTIONS_RUNTIME_TOKEN }}
ACTIONS_RESULTS_URL: ${{ env.GITHUB_ACTIONS_RESULTS_URL }}
- name: Build and upload prerelease comment
run: node .github/prereleases/3-comment.mjs
env:
# Required by the `@actions/artifact` package
ACTIONS_RUNTIME_TOKEN: ${{ env.GITHUB_ACTIONS_RUNTIME_TOKEN }}
ACTIONS_RESULTS_URL: ${{ env.GITHUB_ACTIONS_RESULTS_URL }}