diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f0cc27..522a997 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,7 +55,7 @@ jobs: - name: Set up Rust toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: - components: clippy, rustfmt, rust-src + components: clippy, rustfmt - name: Test - run: cargo test --all-features --locked --release + run: cargo test --all-features --all-targets --locked --release diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..aa1f5da --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + publish: + name: Publish + runs-on: ubuntu-latest + + permissions: + contents: read + id-token: write + + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Set up Rust toolchain + uses: actions-rust-lang/setup-rust-toolchain@v1 + + - name: Install Cargo Binary Install + uses: cargo-bins/cargo-binstall@main + + - name: Install crates + run: cargo binstall --force -y cargo-workspaces + + - uses: rust-lang/crates-io-auth-action@v1 + id: auth + + - name: Publish + run: cargo workspaces publish --publish-as-is + env: + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f86a204..3684935 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,6 +51,7 @@ jobs: run: git add . - name: Commit + id: commit uses: dsanders11/github-app-commit-action@v1 with: message: ${{ steps.extract-version.outputs.VERSION }} @@ -60,11 +61,18 @@ jobs: run: git reset --hard && git pull - name: Tag - uses: bruno-fs/repo-tagger@1.0.0 - with: - tag: ${{ steps.extract-version.outputs.VERSION }} + uses: actions/github-script@v8 env: - GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} + GIT_TAG: ${{ steps.extract-version.outputs.VERSION }} + GIT_SHA: ${{ steps.commit.outputs.sha }} + with: + script: | + github.rest.git.createRef({ + owner: context.repo.owner, + repo: context.repo.repo, + ref: `refs/tags/${process.env.GIT_TAG}`, + sha: process.env.GIT_SHA + }) - name: Release uses: softprops/action-gh-release@v2 @@ -73,6 +81,3 @@ jobs: make_latest: true tag_name: ${{ steps.extract-version.outputs.VERSION }} token: ${{ steps.app-token.outputs.token }} - - - name: Publish - run: cargo workspaces publish --publish-as-is --token "${{ secrets.CRATES_IO_TOKEN }}"