mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
ci: use action to avoid rate limiting (#3950)
This commit is contained in:
parent
71e24b7e81
commit
54c20db6cf
10
.github/workflows/publish-examples.yml
vendored
10
.github/workflows/publish-examples.yml
vendored
@ -32,8 +32,18 @@ jobs:
|
||||
with:
|
||||
version: 'latest'
|
||||
|
||||
- name: Get latest wasm-opt version
|
||||
id: wasm-opt
|
||||
uses: pozetroninc/github-action-get-latest-release@master
|
||||
with:
|
||||
repository: WebAssembly/binaryen
|
||||
excludes: prerelease, draft
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build examples
|
||||
run: cargo run -p build-examples --bin build-examples
|
||||
env:
|
||||
LATEST_WASM_OPT_VERSION: ${{ steps.wasm-opt.outputs.release }}
|
||||
|
||||
- name: Deploy to Firebase
|
||||
uses: siku2/action-hosting-deploy@v1
|
||||
|
||||
10
.github/workflows/size-cmp.yml
vendored
10
.github/workflows/size-cmp.yml
vendored
@ -59,8 +59,18 @@ jobs:
|
||||
with:
|
||||
version: "latest"
|
||||
|
||||
- name: Get latest wasm-opt version
|
||||
id: wasm-opt
|
||||
uses: pozetroninc/github-action-get-latest-release@master
|
||||
with:
|
||||
repository: WebAssembly/binaryen
|
||||
excludes: prerelease, draft
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build examples
|
||||
run: cargo run -p build-examples --bin build-examples
|
||||
env:
|
||||
LATEST_WASM_OPT_VERSION: ${{ steps.wasm-opt.outputs.release }}
|
||||
|
||||
- name: Collect size information
|
||||
run: python3 ci/collect_sizes.py
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
use std::{env, fs};
|
||||
|
||||
use serde::Deserialize;
|
||||
use toml::Table;
|
||||
@ -13,6 +13,16 @@ struct GitHubRelease {
|
||||
}
|
||||
|
||||
pub fn get_latest_wasm_opt_version() -> String {
|
||||
if let Ok(version) = env::var("LATEST_WASM_OPT_VERSION") {
|
||||
if !version.is_empty() {
|
||||
return version;
|
||||
}
|
||||
}
|
||||
|
||||
get_latest_wasm_opt_version_from_api()
|
||||
}
|
||||
|
||||
fn get_latest_wasm_opt_version_from_api() -> String {
|
||||
let url = "https://api.github.com/repos/WebAssembly/binaryen/releases/latest";
|
||||
let client = reqwest::blocking::Client::new();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user