Skip to content

Commit 8ac3254

Browse files
committed
Revert "Next swc publish flow (#27932)"
This reverts commit 94fc6f0.
1 parent 6014b6e commit 8ac3254

File tree

14 files changed

+103
-252
lines changed

14 files changed

+103
-252
lines changed

.github/workflows/build_native.yml

+99-27
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,154 @@
1-
on: workflow_dispatch
1+
on:
2+
workflow_dispatch:
3+
pull_request:
4+
types: [opened, synchronize]
5+
paths:
6+
- 'packages/next/build/swc/**'
27

38
name: Build next-swc native binaries
49

510
jobs:
6-
build-native:
11+
build:
712
strategy:
813
matrix:
914
os: [ubuntu-18.04, macos-latest, windows-latest]
10-
description: [default]
11-
include:
12-
- os: ubuntu-18.04
13-
target: x86_64-unknown-linux-gnu
14-
- os: windows-latest
15-
target: x86_64-pc-windows-msvc
16-
- os: macos-latest
17-
target: x86_64-apple-darwin
18-
- os: macos-latest
19-
target: aarch64-apple-darwin
20-
description: m1
21-
22-
name: next-swc - ${{ matrix.os }} - ${{ matrix.target }} - node@14
15+
16+
name: stable - ${{ matrix.os }} - node@14
2317
runs-on: ${{ matrix.os }}
2418

2519
steps:
2620
- uses: actions/checkout@v2
21+
2722
- name: Setup node
2823
uses: actions/setup-node@v2
2924
with:
3025
node-version: 14
3126
check-latest: true
27+
3228
- name: Install
3329
uses: actions-rs/toolchain@v1
3430
with:
31+
toolchain: stable
3532
profile: minimal
36-
toolchain: nightly-2021-03-25
37-
target: ${{ matrix.target }}
33+
3834
- name: Cache cargo registry
3935
uses: actions/cache@v1
4036
with:
4137
path: ~/.cargo/registry
4238
key: stable-${{ matrix.os }}-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
39+
4340
- name: Cache cargo index
4441
uses: actions/cache@v1
4542
with:
4643
path: ~/.cargo/git
4744
key: stable-${{ matrix.os }}-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
48-
- name: Cache native binary
49-
id: binary-cache
50-
uses: actions/cache@v2
45+
46+
- name: Cache NPM dependencies
47+
uses: actions/cache@v1
5148
with:
52-
path: packages/next/native/**
53-
key: next-swc-nightly-2021-03-25-${{ matrix.target }}-${{ hashFiles('packages/next/build/swc/**') }}
49+
path: node_modules
50+
key: npm-cache-${{ matrix.os }}-node@14-${{ hashFiles('yarn.lock') }}
51+
52+
- name: 'Install dependencies'
53+
run: yarn install --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
54+
5455
- name: 'Build'
55-
if: steps.binary-cache.outputs.cache-hit != true
56-
run: yarn build-native --target ${{ matrix.target }}
56+
run: yarn --cwd packages/next build-native
5757
env:
5858
MACOSX_DEPLOYMENT_TARGET: '10.13'
59-
working-directory: packages/next
59+
60+
- name: Upload artifact
61+
uses: actions/upload-artifact@v2
62+
with:
63+
name: next-swc-binaries
64+
path: packages/next/native
65+
66+
- name: Clear the cargo caches
67+
run: |
68+
cargo install cargo-cache --no-default-features --features ci-autoclean
69+
cargo-cache
70+
71+
build-apple-silicon:
72+
name: stable - aarch64-apple-darwin - node@14
73+
runs-on: macos-latest
74+
75+
steps:
76+
- uses: actions/checkout@v2
77+
78+
- name: Setup node
79+
uses: actions/setup-node@v2
80+
with:
81+
node-version: 14
82+
83+
- name: Install Rust
84+
uses: actions-rs/toolchain@v1
85+
with:
86+
profile: minimal
87+
override: true
88+
toolchain: nightly-2021-03-25
89+
target: aarch64-apple-darwin
90+
91+
- name: Install dependencies
92+
run: yarn install --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
93+
94+
- name: Cross build aarch64
95+
run: yarn --cwd packages/next build-native --target aarch64-apple-darwin
96+
6097
- name: Upload artifact
6198
uses: actions/upload-artifact@v2
6299
with:
63100
name: next-swc-binaries
64-
path: packages/next/native/next-swc.*.node
101+
path: packages/next/native
102+
65103
- name: Clear the cargo caches
66104
run: |
67105
cargo install cargo-cache --no-default-features --features ci-autoclean
68106
cargo-cache
107+
69108
commit:
70-
needs: build-native
109+
needs: [build, build-apple-silicon]
71110
runs-on: ubuntu-18.04
72111

73112
steps:
74113
- uses: actions/checkout@v2
114+
if: ${{ github.event_name == 'workflow_dispatch' }}
75115
- uses: actions/download-artifact@v2
76116
with:
77117
name: next-swc-binaries
78118
path: packages/next/native
119+
if: ${{ github.event_name == 'workflow_dispatch' }}
79120
- uses: EndBug/add-and-commit@v7
80121
with:
81122
add: 'packages/next/native --force'
82123
message: 'Build next-swc binaries'
124+
if: ${{ github.event_name == 'workflow_dispatch' }}
125+
126+
check:
127+
needs: [build, build-apple-silicon]
128+
runs-on: ubuntu-18.04
129+
130+
steps:
131+
- uses: actions/checkout@v2
132+
if: ${{ github.event_name == 'pull_request' }}
133+
- uses: actions/download-artifact@v2
134+
with:
135+
name: next-swc-binaries
136+
path: packages/next/native
137+
if: ${{ github.event_name == 'pull_request' }}
138+
- run: git diff --exit-code
139+
if: ${{ github.event_name == 'pull_request' }}
140+
141+
test:
142+
runs-on: ubuntu-18.04
143+
144+
steps:
145+
- uses: actions/checkout@v2
146+
if: ${{ github.event_name == 'pull_request' }}
147+
- name: Install
148+
if: ${{ github.event_name == 'pull_request' }}
149+
uses: actions-rs/toolchain@v1
150+
with:
151+
toolchain: nightly-2021-03-25
152+
profile: minimal
153+
- run: cd packages/next/build/swc && cargo test
154+
if: ${{ github.event_name == 'pull_request' }}

.github/workflows/build_test_deploy.yml

+3-90
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
on:
22
push:
33
branches: [canary]
4-
tags: [v*]
54
pull_request:
65
types: [opened, synchronize]
76

@@ -47,7 +46,7 @@ jobs:
4746
checkPrecompiled:
4847
name: Check Pre-compiled
4948
runs-on: ubuntu-latest
50-
needs: [build, build-native]
49+
needs: build
5150
env:
5251
NEXT_TELEMETRY_DISABLED: 1
5352
steps:
@@ -57,10 +56,6 @@ jobs:
5756
with:
5857
path: ./*
5958
key: ${{ github.sha }}
60-
- uses: actions/download-artifact@v2
61-
with:
62-
name: next-swc-binaries
63-
path: packages/next/native
6459
- run: ./scripts/check-pre-compiled.sh
6560
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
6661

@@ -245,10 +240,9 @@ jobs:
245240
if: ${{needs.build.outputs.docsChange != 'docs only change'}}
246241

247242
publishRelease:
248-
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
249243
name: Potentially publish release
250244
runs-on: ubuntu-latest
251-
needs: [build, build-native]
245+
needs: build
252246
env:
253247
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
254248
steps:
@@ -257,11 +251,7 @@ jobs:
257251
with:
258252
path: ./*
259253
key: ${{ github.sha }}
260-
- uses: actions/download-artifact@v2
261-
with:
262-
name: next-swc-binaries
263-
path: packages/next/native
264-
- run: ./scripts/prepublish-native.js
254+
265255
- run: ./scripts/publish-release.sh
266256

267257
releaseStats:
@@ -278,80 +268,3 @@ jobs:
278268
- uses: ./.github/actions/next-stats-action
279269
env:
280270
PR_STATS_COMMENT_TOKEN: ${{ secrets.PR_STATS_COMMENT_TOKEN }}
281-
282-
build-native:
283-
strategy:
284-
matrix:
285-
os: [ubuntu-18.04, macos-latest, windows-latest]
286-
description: [default]
287-
include:
288-
- os: ubuntu-18.04
289-
target: x86_64-unknown-linux-gnu
290-
- os: windows-latest
291-
target: x86_64-pc-windows-msvc
292-
- os: macos-latest
293-
target: x86_64-apple-darwin
294-
- os: macos-latest
295-
target: aarch64-apple-darwin
296-
description: m1
297-
298-
name: next-swc - ${{ matrix.os }} - ${{ matrix.target }} - node@14
299-
runs-on: ${{ matrix.os }}
300-
301-
steps:
302-
- uses: actions/checkout@v2
303-
- name: Setup node
304-
uses: actions/setup-node@v2
305-
with:
306-
node-version: 14
307-
check-latest: true
308-
- name: Install
309-
uses: actions-rs/toolchain@v1
310-
with:
311-
profile: minimal
312-
toolchain: nightly-2021-03-25
313-
target: ${{ matrix.target }}
314-
- name: Cache cargo registry
315-
uses: actions/cache@v1
316-
with:
317-
path: ~/.cargo/registry
318-
key: stable-${{ matrix.os }}-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
319-
- name: Cache cargo index
320-
uses: actions/cache@v1
321-
with:
322-
path: ~/.cargo/git
323-
key: stable-${{ matrix.os }}-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
324-
- name: Cache native binary
325-
id: binary-cache
326-
uses: actions/cache@v2
327-
with:
328-
path: packages/next/native/**
329-
key: next-swc-nightly-2021-03-25-${{ matrix.target }}-${{ hashFiles('packages/next/build/swc/**') }}
330-
- name: 'Build'
331-
if: steps.binary-cache.outputs.cache-hit != true
332-
run: yarn build-native --target ${{ matrix.target }}
333-
env:
334-
MACOSX_DEPLOYMENT_TARGET: '10.13'
335-
working-directory: packages/next
336-
- name: Upload artifact
337-
uses: actions/upload-artifact@v2
338-
with:
339-
name: next-swc-binaries
340-
path: packages/next/native/next-swc.*.node
341-
- name: Clear the cargo caches
342-
run: |
343-
cargo install cargo-cache --no-default-features --features ci-autoclean
344-
cargo-cache
345-
346-
test-native:
347-
name: Unit Test Native Code
348-
runs-on: ubuntu-18.04
349-
350-
steps:
351-
- uses: actions/checkout@v2
352-
- name: Install
353-
uses: actions-rs/toolchain@v1
354-
with:
355-
toolchain: nightly-2021-03-25
356-
profile: minimal
357-
- run: cd packages/next/build/swc && cargo test

packages/next/build/swc/npm/next-swc-darwin-arm64/README.md

-3
This file was deleted.

packages/next/build/swc/npm/next-swc-darwin-arm64/package.json

-18
This file was deleted.

packages/next/build/swc/npm/next-swc-darwin-x64/README.md

-3
This file was deleted.

packages/next/build/swc/npm/next-swc-darwin-x64/package.json

-18
This file was deleted.

packages/next/build/swc/npm/next-swc-linux-x64-gnu/README.md

-3
This file was deleted.

packages/next/build/swc/npm/next-swc-linux-x64-gnu/package.json

-18
This file was deleted.

packages/next/build/swc/npm/next-swc-win32-x64-msvc/README.md

-3
This file was deleted.

0 commit comments

Comments
 (0)