From 3fbd1b4893be827926ae5480acef73abdfac87db Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Mon, 5 Feb 2024 09:01:25 -0500 Subject: [PATCH] ci: move crate publish out of ci.yml --- .github/workflows/ci.yml | 44 ---------------------------------------- 1 file changed, 44 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c508b2..d42734b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,47 +40,3 @@ jobs: cache-on-failure: true - name: Run tests run: cargo test - - check-published-version: - name: Check published version - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - needs: - - Check - - Test - - steps: - - name: Check out repository - uses: actions/checkout@v4 - - name: Install gojq - run: sudo apt-get install gojq - - name: 'Check if crate ${{ inputs.crate }} is published' - run: | - set -euxo pipefail - url="https://raw.githubusercontent.com/rust-lang/crates.io-index/master/ca/tp/catppuccin-egui" - published="$(curl -fsSL "$url" | gojq -sr 'map(.vers) | sort | .[-1]')" - manifest="$(awk -F \" '/version = / { print $2 }' Cargo.toml)" - - if [ "$manifest" = "$published" ]; then - echo 'new_version=no' >> $GITHUB_OUTPUT - else - echo 'new_version=yes' >> $GITHUB_OUTPUT - fi - - Publish: - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' && needs.check-published-version.outputs.new_version == 'yes' - environment: crates.io - needs: - - check-published-version - - steps: - - name: Check out repository - uses: actions/checkout@v4 - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - - name: Publish crates - run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}