-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
228 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
name: Release | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
env: | ||
PUBLISH_NPM: "dummy" | ||
PUBLISH_BIN: "dummy" | ||
BIN_CODENAME: dummy"" | ||
|
||
jobs: | ||
vars: | ||
name: Generate Variables | ||
runs-on: ubuntu-latest | ||
outputs: | ||
BRANCH_NAME: ${{ steps.step1.outputs.BRANCH_NAME }} | ||
NPM_TAG: ${{ steps.step1.outputs.NPM_TAG }} | ||
NEXT_NPM_VERSION: ${{ steps.step1.outputs.NEXT_NPM_VERSION }} | ||
NEXT_BIN_VERSION: ${{ steps.step1.outputs.NEXT_BIN_VERSION }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: step1 | ||
run: | | ||
npm install -g pnpm && pnpm i | ||
export BRANCH_NAME=${GITHUB_REF##*/} | ||
export NPM_TAG=$BRANCH_NAME | ||
if [ $NPM_TAG = "main" ]; then | ||
export NPM_TAG="latest" | ||
fi | ||
if [ "$PUBLISH_NPM" = "true" ]; then | ||
NEXT_NPM_VERSION="$(node .github/scripts/ci/next-npm-version.mjs)" | ||
echo "NEXT_NPM_VERSION=$NEXT_NPM_VERSION" >> $GITHUB_OUTPUT | ||
echo NEXT_NPM_VERSION = $NEXT_NPM_VERSION | ||
fi | ||
if [ "$PUBLISH_BIN" = "true" ]; then | ||
NEXT_BIN_VERSION="$(node .github/scripts/ci/next-github-release.mjs)" | ||
echo "NEXT_BIN_VERSION=$NEXT_BIN_VERSION" >> $GITHUB_OUTPUT | ||
echo NEXT_BIN_VERSION = $NEXT_BIN_VERSION | ||
fi | ||
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_OUTPUT | ||
echo "NPM_TAG=$NPM_TAG" >> $GITHUB_OUTPUT | ||
linux-amd64: | ||
name: "Build: linux-amd64" | ||
runs-on: ubuntu-latest | ||
needs: [vars] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: { node-version: 20 } | ||
|
||
- name: Setup Dependencies | ||
run: | | ||
sudo apt-get update | ||
npm install -g npm pnpm | ||
pnpm install | ||
rustup target add x86_64-unknown-linux-gnu | ||
- name: Build | ||
env: | ||
BIN_VERSION: ${{ needs.vars.outputs.NEXT_BIN_VERSION }} | ||
run: | | ||
node .github/scripts/run.mjs build --profile release-lto --target x86_64-unknown-linux-gnu | ||
linux-arm64: | ||
name: "Build: linux-arm64" | ||
runs-on: ubuntu-latest | ||
needs: [vars] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: { node-version: 20 } | ||
|
||
- name: Setup Dependencies | ||
run: | | ||
sudo apt-get update | ||
npm install -g npm pnpm | ||
pnpm install | ||
sudo apt-get install gcc-aarch64-linux-gnu build-essential | ||
rustup target add aarch64-unknown-linux-gnu | ||
aarch64-linux-gnu-gcc --version | ||
- name: Build | ||
env: | ||
BIN_VERSION: ${{ needs.vars.outputs.NEXT_BIN_VERSION }} | ||
run: | | ||
export CC=aarch64-linux-gnu-gcc | ||
node .github/scripts/run.mjs build --profile release-lto --target aarch64-unknown-linux-gnu | ||
macos-amd64: | ||
name: "Build: macos-amd64" | ||
runs-on: macos-13 | ||
needs: [vars] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: { node-version: 20 } | ||
|
||
- name: Setup Dependencies | ||
run: | | ||
npm install -g npm pnpm | ||
pnpm install | ||
rustup target add x86_64-apple-darwin | ||
- name: Build | ||
env: | ||
BIN_VERSION: ${{ needs.vars.outputs.NEXT_BIN_VERSION }} | ||
run: | | ||
node .github/scripts/run.mjs build --profile release-lto --target x86_64-apple-darwin | ||
macos-arm64: | ||
name: "Build: macos-arm64" | ||
runs-on: macos-13 | ||
needs: [vars] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: { node-version: 20 } | ||
|
||
- name: Setup Dependencies | ||
run: | | ||
npm install -g npm pnpm | ||
pnpm install | ||
rustup target add aarch64-apple-darwin | ||
- name: Build | ||
env: | ||
BIN_VERSION: ${{ needs.vars.outputs.NEXT_BIN_VERSION }} | ||
run: | | ||
node .github/scripts/run.mjs build --profile release-lto --target aarch64-apple-darwin | ||
windows-amd64: | ||
name: "Build: windows-amd64" | ||
runs-on: windows-latest | ||
needs: [vars] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: { node-version: 20 } | ||
|
||
- name: Setup Dependencies | ||
run: | | ||
npm install -g npm pnpm | ||
pnpm install | ||
rustup target add x86_64-pc-windows-msvc | ||
- name: Build | ||
env: | ||
BIN_VERSION: ${{ needs.vars.outputs.NEXT_BIN_VERSION }} | ||
run: | | ||
node .github/scripts/run.mjs build --profile release-lto --target x86_64-pc-windows-msvc | ||
windows-arm64: | ||
name: "Build: windows-arm64" | ||
runs-on: windows-latest | ||
needs: [vars] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: { node-version: 20 } | ||
|
||
- name: Setup Dependencies | ||
run: | | ||
npm install -g npm pnpm | ||
pnpm install | ||
rustup target add aarch64-pc-windows-msvc | ||
- name: Build | ||
env: | ||
BIN_VERSION: ${{ needs.vars.outputs.NEXT_BIN_VERSION }} | ||
run: | | ||
node .github/scripts/run.mjs build --profile release-lto --target aarch64-pc-windows-msvc | ||
npm-package: | ||
name: "Build: NPM" | ||
runs-on: ubuntu-latest | ||
needs: [vars] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: { node-version: 20 } | ||
- name: Build NPM | ||
env: | ||
BIN_VERSION: ${{ needs.vars.outputs.NEXT_BIN_VERSION }} | ||
NPM_VERSION: ${{ needs.vars.outputs.NEXT_NPM_VERSION }} | ||
NPM_BIN_TARGET: ${{ needs.vars.outputs.BRANCH_NAME }} | ||
run: | | ||
if [ "$PUBLISH_NPM" != "true" ]; then | ||
exit 0 | ||
fi | ||
npm install -g npm pnpm | ||
pnpm install | ||
node .github/scripts/run.mjs build | ||
echo "NPM_VERSION = $NPM_VERSION" | ||
echo "NPM_BIN_TARGET = $NPM_BIN_TARGET" | ||
cd npm/mach | ||
node ./_scripts/prepack/prepack.mjs | ||
rm -rf ./_scripts/prepack | ||
npm pack | ||
mv *.tgz ../../mach-npm.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters