diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 5b9a6c7d..346e6a2b 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: inputs: version: - description: 'Version tag to publish (e.g. v0.3.0)' + description: 'Version tag to publish (e.g. v0.5.3)' required: true env: @@ -35,7 +35,11 @@ jobs: env: DATABASE_URL: "postgres://postgres:postgres@localhost/oxicloud_test" steps: - - uses: actions/checkout@v6 + - name: Checkout + uses: actions/checkout@v6 + with: + # For workflow_dispatch, checkout the exact tag so we build the right code + ref: ${{ github.event.inputs.version || github.ref }} - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 @@ -46,15 +50,18 @@ jobs: - run: cargo test --workspace - # Build and push multi-arch image in a single job + # Build and push multi-arch image build-and-push: name: Build & Push Multi-Arch runs-on: ubuntu-latest - timeout-minutes: 120 + timeout-minutes: 180 needs: test steps: - name: Checkout uses: actions/checkout@v6 + with: + # For workflow_dispatch, checkout the exact tag so we build the right code + ref: ${{ github.event.inputs.version || github.ref }} - name: Set version tag id: version diff --git a/Cargo.toml b/Cargo.toml index a09fd340..d23d8481 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "oxicloud" -version = "0.5.3" +version = "0.5.4" edition = "2024" default-run = "oxicloud" diff --git a/Dockerfile b/Dockerfile index a8269136..525712ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,9 @@ COPY Cargo.toml Cargo.lock ./ COPY build.rs ./ COPY static static # Create a minimal project to download and cache dependencies -RUN mkdir -p src && \ +RUN mkdir -p src/bin && \ echo 'fn main() { println!("Dummy build for caching dependencies"); }' > src/main.rs && \ + echo 'fn main() {}' > src/bin/generate-openapi.rs && \ cargo build --release && \ rm -rf src static-dist target/release/deps/oxicloud* target/release/build/oxicloud-* # Stage 2: Build the application