fix gh-actions
This commit is contained in:
61
.github/workflows/pre-release.yml
vendored
Normal file
61
.github/workflows/pre-release.yml
vendored
Normal file
@@ -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
|
Reference in New Issue
Block a user