Skip to content

Commit

Permalink
Merge branch 'main' into add-workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Its-Just-Nans committed Feb 15, 2025
2 parents 17ca089 + e221ba3 commit 6790db0
Show file tree
Hide file tree
Showing 75 changed files with 4,012 additions and 1,456 deletions.
2 changes: 0 additions & 2 deletions .cargo/config.toml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/brew.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
jobs:
brew:
name: Bump Brew Version
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Release | Brew
uses: mislav/bump-homebrew-formula-action@v3
Expand Down
45 changes: 33 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ on:
branches:
- main
- release/*
merge_group:
types:
- checks_requested

jobs:
lint:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -46,12 +49,12 @@ jobs:
uses: ./.github/workflows/docs.yaml

check:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
rust:
- stable
- 1.75.0 # MSRV
- 1.78.0 # MSRV
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -97,14 +100,20 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
os: [ ubuntu-22.04, macos-14, windows-2022 ]
include:
- os: ubuntu-latest
- os: ubuntu-22.04
binPath: target/debug/trunk
- os: macos-latest
install: |
sudo apt install -y libssl-dev
- os: macos-14
binPath: target/debug/trunk
- os: windows-latest
- os: windows-2022
binPath: target/debug/trunk.exe
install: |
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
vcpkg install openssl:x64-windows-static-md
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -121,6 +130,18 @@ jobs:
target/
key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }}

- name: Setup | Export GitHub Actions cache environment variables
uses: actions/github-script@v7
if: runner.os == 'Windows'
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite');
- name: Setup | Install dependencies
run: ${{ matrix.install }}

- name: Build | Test
run: cargo test

Expand All @@ -142,7 +163,7 @@ jobs:
fail-fast: false
max-parallel: 32
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
os: [ ubuntu-22.04, macos-14, windows-2022 ]
example:
- cargo-manifest
- cdylib
Expand All @@ -157,6 +178,7 @@ jobs:
- webworker
- webworker-gloo
- webworker-module
- wasm_threads
- yew
- yew-tailwindcss
- yew-tls
Expand Down Expand Up @@ -229,7 +251,7 @@ jobs:
- name: Setup | Download CLI
uses: actions/download-artifact@v4
with:
name: test-cli-ubuntu-latest
name: test-cli-ubuntu-22.04

- name: Setup | Make executable
run: chmod a+x $GITHUB_WORKSPACE/trunk
Expand All @@ -240,8 +262,7 @@ jobs:
- name: Diff | Config Schema
run: |
git diff --quiet schemas/config.json
if [ $? -gt 0 ]; then
echo "::error::Uncommitted changes for schemas/config.json (run `cargo run -- config generate-schema schemas/config.json` after making changes to the configuration model)"
if ! git diff --quiet schemas/config.json; then
echo "::error::Uncommitted changes for schemas/config.json (run 'cargo run -- config generate-schema schemas/config.json' after making changes to the configuration model)"
exit 1
fi
4 changes: 2 additions & 2 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: ./.github/workflows/docs.yaml

deploy:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs:
- docs

Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
find ./site/public
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site/public
Expand Down
46 changes: 33 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
strategy:
fail-fast: false
matrix:
rust:
- stable
target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
Expand All @@ -51,25 +53,35 @@ jobs:
os: ubuntu-22.04
name: trunk-aarch64-unknown-linux-gnu.tar.gz
cross: "true"
# cross's container image is too old for us
args: --features vendored

- target: x86_64-unknown-linux-musl
os: ubuntu-22.04
name: trunk-x86_64-unknown-linux-musl.tar.gz
dependencies: musl-tools
install: |
sudo apt install -y musl-tools
args: --features vendored
- target: aarch64-unknown-linux-musl
os: ubuntu-22.04
name: trunk-aarch64-unknown-linux-musl.tar.gz
cross: "true"
args: --features vendored

- target: x86_64-apple-darwin
os: macos-12
os: macos-13
name: trunk-x86_64-apple-darwin.tar.gz
- target: aarch64-apple-darwin
os: macos-12
xcode: "true"
os: macos-14
name: trunk-aarch64-apple-darwin.tar.gz

- target: x86_64-pc-windows-msvc
os: windows-2022
name: trunk-x86_64-pc-windows-msvc.zip
ext: ".exe"
install: |
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
vcpkg install openssl:x64-windows-static-md
runs-on: ${{ matrix.os }}

Expand All @@ -87,11 +99,18 @@ jobs:
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Setup | Dependencies
if: matrix.dependencies != ''
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.dependencies }}
- name: Setup | Export GitHub Actions cache environment variables
uses: actions/github-script@v7
if: runner.os == 'Windows'
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite');
- name: Setup | Install dependencies
if: matrix.install != ''
run: ${{ matrix.install }}

- name: Setup | Disable rustup self-update
# workaround for: https://github.com/rust-lang/rustup/issues/3709
Expand All @@ -100,8 +119,8 @@ jobs:
- name: Setup | Rust
run: |
rustup toolchain install stable --target ${{ matrix.target }} --profile minimal
rustup default stable
rustup toolchain install ${{ matrix.rust }} --target ${{ matrix.target }} --profile minimal
rustup default ${{ matrix.rust }}
- name: Setup | Cross
if: matrix.cross == 'true'
Expand All @@ -126,6 +145,7 @@ jobs:
fi
OPTS="--release"
OPTS="$OPTS ${{ matrix.args }}"
if [[ -n "${{ matrix.target }}" ]]; then
OPTS="$OPTS --target=${{ matrix.target }}"
Expand Down Expand Up @@ -188,7 +208,7 @@ jobs:
needs:
- init
- build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -226,7 +246,7 @@ jobs:
publish:
needs: release
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ target
dist
site/public/*
.vscode
!examples/wasm_threads/.vscode
.idea/
.DS_Store
/vendor
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ Just a few simple items to keep in mind as you hack.

- Pull request early and often. This helps to let others know what you are working on. **Please use GitHub's Draft PR mechanism** if your PR is not yet ready for review.
- Use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/), a changelog will automatically be created from such commits
- When making changes to the configuration, be sure to regenate the schema. This can be done by running:

```shell
cargo run -- config generate-schema schemas/config.json
```

## linting
We are using clippy & rustfmt. Clippy is SO GREAT! Rustfmt ... has a lot more growing to do; however, we are using it for uniformity.
Expand All @@ -22,3 +27,19 @@ We follow [semver](https://semver.org/spec/v2.0.0.html) for versioning this syst
- all release tags should start with the letter `v` followed by a semver version.
- [ ] CI is configured for release tags and will create a new GitHub release, and will upload release artifacts to the release page. Verify that this process has completed successfully.

## SSL

Trunk can use either `native-tls` or `rustls` for SSL support. `rustls` without `aws-lc-sys` is the default backend, which should build out-of-the-box on all platforms.

To opt into a different one, you can use the following command:
```sh
cargo build --no-default-features -F update_check,native-tls
```
If you want to use `native-tls` you can install OpenSSL using the instructions from one of the following resources:
+ https://stackoverflow.com/a/62729715/2961550
+ https://github.com/sfackler/rust-openssl/issues/1062#issuecomment-489441940
Or try using [rust-openssl from PR #2139](https://github.com/sfackler/rust-openssl/pull/2139) by updating the `Cargo.toml` file with
```diff
- openssl = { version = "0.10", default-features = false, optional = true }
+ openssl = { git = "https://github.com/micolous/rust-openssl", branch = "windows-build", default-features = false, optional = true }
```
Loading

0 comments on commit 6790db0

Please sign in to comment.