From aab0c39236cddacc02e3837d1b1147977ec57bff Mon Sep 17 00:00:00 2001 From: syui Date: Sat, 9 Aug 2025 18:20:56 +0900 Subject: [PATCH] fix gh-actions --- .github/workflows/pre-release.yml | 61 +++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/pre-release.yml diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml new file mode 100644 index 0000000..7ec1caa --- /dev/null +++ b/.github/workflows/pre-release.yml @@ -0,0 +1,61 @@ +name: Pre-release Test + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test-build: + name: Test Build and Version Sync + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Install jq + run: | + sudo apt-get update + sudo apt-get install -y jq + + - name: Test version sync + run: | + chmod +x scripts/sync-versions.sh + ./scripts/sync-versions.sh + + - name: Setup Rust + uses: dtolnay/rust-toolchain@stable + + - name: Cache cargo + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Test build + run: cargo build --release + + - name: Test version consistency + run: | + CARGO_VERSION=$(grep '^version = ' Cargo.toml | cut -d'"' -f2) + OAUTH_VERSION=$(jq -r '.version' oauth/package.json) + PDS_VERSION=$(jq -r '.version' pds/package.json) + + echo "Cargo.toml: $CARGO_VERSION" + echo "oauth/package.json: $OAUTH_VERSION" + echo "pds/package.json: $PDS_VERSION" + + if [[ "$CARGO_VERSION" != "$OAUTH_VERSION" ]] || [[ "$CARGO_VERSION" != "$PDS_VERSION" ]]; then + echo "❌ Version mismatch detected!" + exit 1 + else + echo "✅ All versions are synchronized" + fi \ No newline at end of file