diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..a58e21f --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,40 @@ +name: Publish Docker image + +on: + push: + branches: [main] + +jobs: + push_to_registry: + name: Push Docker image to the registry + runs-on: ubuntu-22.04 + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Build and push Docker image (aarch64) + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/arm64 + id: build-aarch64 + + - name: Extract file (aarch64) + run: ID=$(docker create ${{ steps.build-aarch64.outputs.imageid }}) docker cp $ID:/opt/app/target/release/libbliss_js.so index-aarch64-unknown-linux-gnu.node; docker rm $ID + + - name: Build and push Docker image (x86_64) + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64 + id: build-x86_64 + + - name: Extract file (x86_64) + run: ID=$(docker create ${{ steps.build-x86_64.outputs.imageid }}) docker cp $ID:/opt/app/target/release/libbliss_js.so index-x86_64-unknown-linux-gnu.node; docker rm $ID + + - name: Log in to NPM + run: | + npm config set @bliss-rs:registry https://gitea.antonlyap.pp.ua/api/packages/antonlyap/npm/ && \ + echo //gitea.antonlyap.pp.ua/api/packages/antonlyap/npm/:_authToken=${{ secrets.NPM_TOKEN }} > ~/.npmrc + + - run: npm publish diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b2eecae --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM gitea.antonlyap.pp.ua/antonlyap/ffmpeg-min:6.1 as ffmpeg + +FROM rust:1-bookworm +COPY --from=ffmpeg /opt/ffmpeg-build/ /usr/ + +RUN apt-get update +RUN apt-get install libclang-dev + +COPY . /opt/app +WORKDIR /opt/app + +RUN cargo build --release diff --git a/package.json b/package.json index 128d7ff..4877f60 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bliss-rs/bliss-rs", - "version": "0.0.4", + "version": "0.0.5", "description": "A fork of the bliss-rs library with Node.js bindings", "main": "index.js", "types": "index.d.ts",