From 3330c0efd86140442d4a9b1df10da811e4329dc6 Mon Sep 17 00:00:00 2001 From: Gabriele Picco Date: Sun, 25 Feb 2024 19:18:19 +0100 Subject: [PATCH] :green_heart: Fix CI/CD --- .github/workflows/publish-bolt-crates.yml | 29 +++++++++++-------- .github/workflows/publish-bolt-sdk.yml | 2 +- .github/workflows/publish-packages.yml | 1 + Cargo.lock | 2 +- Cargo.toml | 2 ++ .../attribute/system-template/Cargo.toml | 14 +++++---- 6 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/publish-bolt-crates.yml b/.github/workflows/publish-bolt-crates.yml index a5e4230..12fe063 100644 --- a/.github/workflows/publish-bolt-crates.yml +++ b/.github/workflows/publish-bolt-crates.yml @@ -94,7 +94,7 @@ jobs: - name: Run lint run: yarn lint - test: + test-and-publish: needs: [clippy-lint, yarn-lint] runs-on: ubuntu-latest @@ -185,17 +185,22 @@ jobs: if [ "${DRY_RUN}" = "true" ]; then DRY_RUN_FLAG="--dry-run" fi - - cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component/Cargo.toml --token ${CRATES_TOKEN} - cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component-deserialize/Cargo.toml --token ${CRATES_TOKEN} - cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component-id/Cargo.toml --token ${CRATES_TOKEN} - cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/system/Cargo.toml --token ${CRATES_TOKEN} - cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/system-input/Cargo.toml --token ${CRATES_TOKEN} - cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/bolt-program/Cargo.toml --token ${CRATES_TOKEN} - cargo publish $DRY_RUN_FLAG --manifest-path=programs/bolt-system/Cargo.toml --token ${CRATES_TOKEN} - cargo publish $DRY_RUN_FLAG --manifest-path=programs/bolt-component/Cargo.toml --token ${CRATES_TOKEN} - cargo publish $DRY_RUN_FLAG --manifest-path=programs/world/Cargo.toml --token ${CRATES_TOKEN} - cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/Cargo.toml --token ${CRATES_TOKEN} + + if [ "${DRY_RUN}" = "true" ]; then + NO_VERIFY_FLAG="--no-verify" + fi + + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component-deserialize/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component-id/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/system/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/system-input/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/bolt-program/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/utils/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=programs/bolt-system/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=programs/bolt-component/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=programs/world/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG + cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/Cargo.toml --token ${CRATES_TOKEN} $NO_VERIFY_FLAG env: CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} DRY_RUN: ${{ env.DRY_RUN }} diff --git a/.github/workflows/publish-bolt-sdk.yml b/.github/workflows/publish-bolt-sdk.yml index ead10dc..4504cb7 100644 --- a/.github/workflows/publish-bolt-sdk.yml +++ b/.github/workflows/publish-bolt-sdk.yml @@ -181,11 +181,11 @@ jobs: - name: npm publish run: | + npm install --only=dev echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} cd clients/bolt-sdk/ && yarn build && yarn lint:fix && cd ../../ && yarn lint:fix cd clients/bolt-sdk/ - npm install --only=dev if [ "${DRY_RUN}" = "true" ]; then echo "Running npm publish in dry-run mode" npm publish --access public --dry-run diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index 05fffd5..40e2db6 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -179,6 +179,7 @@ jobs: fi env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + DRY_RUN: ${{ env.DRY_RUN }} publish-wrapper-npm-package: name: Publish wrapper NPM packages runs-on: ubuntu-20.04 diff --git a/Cargo.lock b/Cargo.lock index bc8516f..706f632 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -990,7 +990,7 @@ version = "0.0.1" [[package]] name = "bolt-helpers-system-template" -version = "0.0.1" +version = "0.0.2" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 839bf1d..598c12d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,8 +21,10 @@ bolt-attribute-bolt-system = { path = "crates/bolt-lang/attribute/system", versi bolt-attribute-bolt-system-input = { path = "crates/bolt-lang/attribute/system-input", version = "=0.0.2" } bolt-attribute-bolt-component-deserialize = { path = "crates/bolt-lang/attribute/component-deserialize", version = "=0.0.2" } bolt-attribute-bolt-component-id = { path = "crates/bolt-lang/attribute/component-id", version = "=0.0.2" } +bolt-utils = { path = "crates/bolt-lang/utils", version = "=0.0.2" } world = { path = "programs/world", features = ["cpi"], version = "=0.0.2"} bolt-system = { path = "programs/bolt-system", features = ["cpi"], version = "=0.0.2"} +bolt-component = { path = "programs/bolt-component", features = ["cpi"], version = "=0.0.2"} ## External crates anchor-lang = "0.29.0" diff --git a/crates/bolt-helpers/attribute/system-template/Cargo.toml b/crates/bolt-helpers/attribute/system-template/Cargo.toml index a096842..c3e480b 100644 --- a/crates/bolt-helpers/attribute/system-template/Cargo.toml +++ b/crates/bolt-helpers/attribute/system-template/Cargo.toml @@ -1,12 +1,16 @@ [package] name = "bolt-helpers-system-template" -version = "0.0.1" -edition = "2021" +version = { workspace = true } +authors = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +license = { workspace = true } +edition = { workspace = true } [lib] proc-macro = true [dependencies] -proc-macro2 = "1.0" -quote = "1.0" -syn = "1.0" \ No newline at end of file +proc-macro2 = { workspace = true } +quote = { workspace = true } +syn = { workspace = true } \ No newline at end of file