Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
JoCat committed Jan 12, 2025
1 parent af207f2 commit 6e5c7f3
Showing 1 changed file with 133 additions and 135 deletions.
268 changes: 133 additions & 135 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
push:
branches:
- main
- testing
- next
tags-ignore:
- "**"
paths-ignore:
Expand All @@ -21,150 +21,148 @@ on:
- docs/**
pull_request: null
jobs:
# build:
# strategy:
# fail-fast: false
# matrix:
# settings:
# - host: macos-latest
# target: x86_64-apple-darwin
# build: yarn build --target x86_64-apple-darwin
# - host: windows-latest
# build: yarn build --target x86_64-pc-windows-msvc
# target: x86_64-pc-windows-msvc
# - host: ubuntu-latest
# target: x86_64-unknown-linux-gnu
# build: yarn build --target x86_64-unknown-linux-gnu
# name: stable - ${{ matrix.settings.target }} - node@22
# runs-on: ${{ matrix.settings.host }}
# steps:
# - uses: actions/checkout@v4
# - name: Setup node
# uses: actions/setup-node@v4
# if: ${{ !matrix.settings.docker }}
# with:
# node-version: 22
# cache: yarn
# - name: Install
# uses: dtolnay/rust-toolchain@stable
# if: ${{ !matrix.settings.docker }}
# with:
# toolchain: stable
# targets: ${{ matrix.settings.target }}
# - name: Cache cargo
# uses: actions/cache@v4
# with:
# path: |
# ~/.cargo/registry/index/
# ~/.cargo/registry/cache/
# ~/.cargo/git/db/
# .cargo-cache
# target/
# key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
# - uses: goto-bus-stop/setup-zig@v2
# if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' || matrix.settings.target == 'armv7-unknown-linux-musleabihf' }}
# with:
# version: 0.13.0
# - name: Setup toolchain
# run: ${{ matrix.settings.setup }}
# if: ${{ matrix.settings.setup }}
# shell: bash
# - name: Setup node x86
# if: matrix.settings.target == 'i686-pc-windows-msvc'
# run: yarn config set supportedArchitectures.cpu "ia32"
# shell: bash
# - name: Install linux dependencies
# if: matrix.settings.host == 'ubuntu-latest'
# run: |
# sudo apt update
# sudo apt install -y libgtk-3-dev libwebkit2gtk-4.1-dev
# - name: Install dependencies
# run: yarn install
# - name: Setup node x86
# uses: actions/setup-node@v4
# if: matrix.settings.target == 'i686-pc-windows-msvc'
# with:
# node-version: 22
# cache: yarn
# architecture: x86
# - name: Build
# run: ${{ matrix.settings.build }}
# shell: bash
# - name: Upload artifact
# uses: actions/upload-artifact@v4
# with:
# name: bindings-${{ matrix.settings.target }}
# path: ${{ env.APP_NAME }}.*.node
# if-no-files-found: error
# test-bindings:
# name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }}
# needs:
# - build
# strategy:
# fail-fast: false
# matrix:
# settings:
# - host: macos-latest
# target: x86_64-apple-darwin
# - host: windows-latest
# target: x86_64-pc-windows-msvc
# # - host: ubuntu-latest
# # target: x86_64-unknown-linux-gnu
# node:
# - "22"
# runs-on: ${{ matrix.settings.host }}
# steps:
# - uses: actions/checkout@v4
# - name: Setup node
# uses: actions/setup-node@v4
# with:
# node-version: ${{ matrix.node }}
# cache: yarn
# architecture: x64
# - name: Install dependencies
# run: yarn install
# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# name: bindings-${{ matrix.settings.target }}
# path: .
# - name: Install linux dependencies
# if: matrix.settings.host == 'ubuntu-latest'
# run: |
# sudo apt update
# sudo apt install -y libgtk-3-dev libwebkit2gtk-4.1-dev
# - name: Test bindings
# run: yarn test
build:
strategy:
fail-fast: false
matrix:
settings:
- host: macos-latest
target: x86_64-apple-darwin
build: yarn build --target x86_64-apple-darwin
- host: windows-latest
build: yarn build --target x86_64-pc-windows-msvc
target: x86_64-pc-windows-msvc
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
build: yarn build --target x86_64-unknown-linux-gnu
name: stable - ${{ matrix.settings.target }} - node@22
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
if: ${{ !matrix.settings.docker }}
with:
node-version: 22
cache: yarn
- name: Install
uses: dtolnay/rust-toolchain@stable
if: ${{ !matrix.settings.docker }}
with:
toolchain: stable
targets: ${{ matrix.settings.target }}
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
.cargo-cache
target/
key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }}
- uses: goto-bus-stop/setup-zig@v2
if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' || matrix.settings.target == 'armv7-unknown-linux-musleabihf' }}
with:
version: 0.13.0
- name: Setup toolchain
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
shell: bash
- name: Setup node x86
if: matrix.settings.target == 'i686-pc-windows-msvc'
run: yarn config set supportedArchitectures.cpu "ia32"
shell: bash
- name: Install linux dependencies
if: matrix.settings.host == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Install dependencies
run: yarn install
- name: Setup node x86
uses: actions/setup-node@v4
if: matrix.settings.target == 'i686-pc-windows-msvc'
with:
node-version: 22
cache: yarn
architecture: x86
- name: Build
run: ${{ matrix.settings.build }}
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error
test-bindings:
name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }}
needs:
- build
strategy:
fail-fast: false
matrix:
settings:
- host: macos-latest
target: x86_64-apple-darwin
- host: windows-latest
target: x86_64-pc-windows-msvc
# - host: ubuntu-latest
# target: x86_64-unknown-linux-gnu
node:
- "22"
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: yarn
architecture: x64
- name: Install dependencies
run: yarn install
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: .
- name: Install linux dependencies
if: matrix.settings.host == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Test bindings
run: yarn test
publish:
name: Publish
runs-on: ubuntu-latest
# needs:
# - test-bindings
needs:
- test-bindings
steps:
# - uses: actions/checkout@v4
# - name: Setup node
# uses: actions/setup-node@v4
# with:
# node-version: 22
# cache: yarn
# - name: Install dependencies
# run: yarn install
# - name: Download all artifacts
# uses: actions/download-artifact@v4
# with:
# path: artifacts
# - name: Move artifacts
# run: yarn artifacts
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 22
cache: yarn
- name: Install dependencies
run: yarn install
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Move artifacts
run: yarn artifacts
- name: Publish
run: |
npm config set provenance true
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
if [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then
echo "On main branch, publishing with public access..."
# npm publish --access public
npm publish --access public
elif [[ "${GITHUB_REF}" == "refs/heads/next" ]]; then
echo "On next branch, publishing with 'next' tag..."
# npm publish --tag next --access public
npm publish --tag next --access public
else
echo "Not on a release branch, skipping publish"
fi
Expand Down

0 comments on commit 6e5c7f3

Please sign in to comment.