Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): Create release before uploading #96

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/publish-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,25 @@ jobs:
shell: bash
run: gh auth login --with-token < <(echo ${{ secrets.GITHUB_TOKEN }})
- run: gh release upload -R bytecodealliance/wasm-pkg-tools --clobber dev target/${{ matrix.rust-target }}/release/wkg-${{ matrix.rust-target }}


create_tagged_release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'bytecodealliance/wasm-pkg-tools'
name: Create tagged release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Login GH CLI
shell: bash
run: gh auth login --with-token < <(echo ${{ secrets.GITHUB_TOKEN }})
- run: gh release create -R bytecodealliance/wasm-pkg-tools ${{ github.ref_name }}

publish_tagged_release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'bytecodealliance/wasm-pkg-tools'
name: Publish to tagged release
runs-on: ${{ matrix.os }}
needs:
- create_tagged_release
strategy:
matrix:
include:
Expand Down Expand Up @@ -114,12 +128,16 @@ jobs:
run: rustup update stable --no-self-update && rustup default stable
- name: Publish wasm-pkg-common
working-directory: ./crates/wasm-pkg-common
# TODO: temporary hack because we can't noop publish. Will remove after release
continue-on-error: true
run: cargo publish
- name: Publish wasm-pkg-client
working-directory: ./crates/wasm-pkg-client
# TODO: temporary hack because we can't noop publish. Will remove after release
continue-on-error: true
run: cargo publish
- name: Publish wkg-core
working-directory: ./crates/wkg-core
- name: Publish wasm-pkg-core
working-directory: ./crates/wasm-pkg-core
run: cargo publish
- name: Publish wkg
working-directory: ./crates/wkg
Expand Down
52 changes: 26 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ wasm-pkg-client = { version = "0.6.0", path = "crates/wasm-pkg-client" }
wasm-metadata = "0.217"
wit-component = "0.217"
wit-parser = "0.217"
wkg-core = { version = "0.6.0", path = "crates/wkg-core" }
wasm-pkg-core = { version = "0.6.0", path = "crates/wasm-pkg-core" }
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "wkg-core"
name = "wasm-pkg-core"
description = "Wasm Package Tools core libraries for wkg"
repository = "https://github.com/bytecodealliance/wasm-pkg-tools/tree/main/crates/wkg-core"
repository = "https://github.com/bytecodealliance/wasm-pkg-tools/tree/main/crates/wasm-pkg-core"
edition.workspace = true
version.workspace = true
authors.workspace = true
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use wasm_pkg_core::{config::Config as WkgConfig, lock::LockFile};
use wit_component::DecodedWasm;
use wkg_core::{config::Config as WkgConfig, lock::LockFile};

mod common;

Expand All @@ -12,7 +12,7 @@ async fn test_build_wit() {
.await
.expect("Should be able to create a new lock file");
let (_temp_cache, client) = common::get_client().await.unwrap();
let (pkg, version, bytes) = wkg_core::wit::build_package(
let (pkg, version, bytes) = wasm_pkg_core::wit::build_package(
&WkgConfig::default(),
fixture_path.join("wit"),
&mut lock,
Expand Down Expand Up @@ -92,7 +92,7 @@ async fn test_bad_dep_failure() {
.await
.expect("Should be able to write the world file");

wkg_core::wit::build_package(
wasm_pkg_core::wit::build_package(
&WkgConfig::default(),
fixture_path.join("wit"),
&mut lock,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::path::Path;

use rstest::rstest;
use tokio::process::Command;
use wkg_core::{
use wasm_pkg_core::{
config::Config,
lock::LockFile,
wit::{self, OutputType},
Expand Down
2 changes: 1 addition & 1 deletion crates/wkg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tracing-subscriber = { workspace = true }
wasm-pkg-common = { workspace = true }
wasm-pkg-client = { workspace = true }
wit-component = { workspace = true }
wkg-core = { workspace = true }
wasm-pkg-core = { workspace = true }

[dev-dependencies]
base64 = { workspace = true }
Expand Down
8 changes: 4 additions & 4 deletions crates/wkg/src/wit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::path::{Path, PathBuf};

use anyhow::Context;
use clap::{Args, Subcommand};
use wkg_core::{
use wasm_pkg_core::{
lock::LockFile,
wit::{self, OutputType},
};
Expand Down Expand Up @@ -88,7 +88,7 @@ impl BuildArgs {
pub async fn run(self) -> anyhow::Result<()> {
check_dir(&self.dir).await?;
let client = self.common.get_client().await?;
let wkg_config = wkg_core::config::Config::load().await?;
let wkg_config = wasm_pkg_core::config::Config::load().await?;
let mut lock_file = LockFile::load(false).await?;
let (pkg_ref, version, bytes) =
wit::build_package(&wkg_config, self.dir, &mut lock_file, client).await?;
Expand All @@ -115,7 +115,7 @@ impl FetchArgs {
pub async fn run(self) -> anyhow::Result<()> {
check_dir(&self.dir).await?;
let client = self.common.get_client().await?;
let wkg_config = wkg_core::config::Config::load().await?;
let wkg_config = wasm_pkg_core::config::Config::load().await?;
let mut lock_file = LockFile::load(false).await?;
wit::fetch_dependencies(
&wkg_config,
Expand All @@ -135,7 +135,7 @@ impl UpdateArgs {
pub async fn run(self) -> anyhow::Result<()> {
check_dir(&self.dir).await?;
let client = self.common.get_client().await?;
let wkg_config = wkg_core::config::Config::load().await?;
let wkg_config = wasm_pkg_core::config::Config::load().await?;
let mut lock_file = LockFile::load(false).await?;
// Clear the lock file since we're updating it
lock_file.packages.clear();
Expand Down