Multi-platform docker image build
This commit is contained in:
parent
df4e6bbd0f
commit
3a8ef207ad
3 changed files with 45 additions and 63 deletions
65
.github/workflows/release.yml
vendored
65
.github/workflows/release.yml
vendored
|
|
@ -78,51 +78,24 @@ jobs:
|
|||
files: |
|
||||
target/artifacts/rqbit-osx-universal
|
||||
|
||||
- name: install linux cross compiler
|
||||
- name: install linux cross compiler toolchains
|
||||
run: brew tap messense/macos-cross-toolchains &&
|
||||
brew install x86_64-unknown-linux-musl aarch64-unknown-linux-gnu arm-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf armv7-unknown-linux-musleabihf
|
||||
brew install x86_64-unknown-linux-musl aarch64-unknown-linux-musl armv7-unknown-linux-musleabihf
|
||||
|
||||
- name: Build release linux x86_64 binary
|
||||
run: rustup target install x86_64-unknown-linux-musl &&
|
||||
make release-linux-x86_64 &&
|
||||
mv target/x86_64-unknown-linux-musl/release-github/rqbit target/artifacts/rqbit-linux-static-x86_64
|
||||
cp -l target/x86_64-unknown-linux-musl/release-github/rqbit target/artifacts/rqbit-linux-static-x86_64-musl
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
generate_release_notes: true
|
||||
files: |
|
||||
target/artifacts/rqbit-linux-static-x86_64
|
||||
|
||||
- name: Archive target/artifacts/rqbit-linux-static-x86_64
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: rqbit-linux-static-x86_64
|
||||
path: target/artifacts/rqbit-linux-static-x86_64
|
||||
|
||||
- name: Build release linux armv6 binary
|
||||
run: rustup target install arm-unknown-linux-gnueabihf &&
|
||||
make release-linux-armv6 &&
|
||||
mv target/arm-unknown-linux-gnueabihf/release-github/rqbit target/artifacts/rqbit-linux-static-armv6
|
||||
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
generate_release_notes: true
|
||||
files: |
|
||||
target/artifacts/rqbit-linux-static-armv6
|
||||
target/artifacts/rqbit-linux-static-x86_64-musl
|
||||
|
||||
- name: Build release linux armv7 binary
|
||||
run: rustup target install armv7-unknown-linux-gnueabihf &&
|
||||
make release-linux-armv7 &&
|
||||
mv target/armv7-unknown-linux-gnueabihf/release-github/rqbit target/artifacts/rqbit-linux-static-armv7
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
generate_release_notes: true
|
||||
files: |
|
||||
target/artifacts/rqbit-linux-static-armv7
|
||||
|
||||
- name: Build release linux armv7 musl binary
|
||||
run: rustup target install armv7-unknown-linux-musleabihf &&
|
||||
make release-linux-armv7-musl &&
|
||||
mv target/armv7-unknown-linux-musleabihf/release-github/rqbit target/artifacts/rqbit-linux-static-armv7-musl
|
||||
cp -l target/armv7-unknown-linux-musleabihf/release-github/rqbit target/artifacts/rqbit-linux-static-armv7-musl
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
generate_release_notes: true
|
||||
|
|
@ -130,27 +103,33 @@ jobs:
|
|||
target/artifacts/rqbit-linux-static-armv7-musl
|
||||
|
||||
- name: Build release linux aarch64 binary
|
||||
run: rustup target install aarch64-unknown-linux-gnu &&
|
||||
run: rustup target install aarch64-unknown-linux-musl &&
|
||||
make release-linux-aarch64 &&
|
||||
mv target/aarch64-unknown-linux-gnu/release-github/rqbit target/artifacts/rqbit-linux-static-aarch64
|
||||
cp -l target/aarch64-unknown-linux-musl/release-github/rqbit target/artifacts/rqbit-linux-static-aarch64-musl
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
generate_release_notes: true
|
||||
files: |
|
||||
target/artifacts/rqbit-linux-static-aarch64
|
||||
target/artifacts/rqbit-linux-static-aarch64-musl
|
||||
|
||||
- name: Create target/docker
|
||||
run: make create-target-docker
|
||||
|
||||
- name: Archive target/docker/
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: target-docker
|
||||
path: target/docker/
|
||||
|
||||
build-push-docker:
|
||||
runs-on: ubuntu-latest
|
||||
needs: cross-compile-on-macos
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Download a single artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: rqbit-linux-static-x86_64
|
||||
|
||||
- name: Move the binary to a different place
|
||||
run: mkdir -p target/x86_64/ && mv rqbit-linux-static-x86_64 target/x86_64/rqbit
|
||||
name: target-docker
|
||||
path: target/docker
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
|
@ -166,6 +145,6 @@ jobs:
|
|||
with:
|
||||
push: true
|
||||
tags: ikatson/rqbit:${{ github.ref_name }}
|
||||
context: target/x86_64/
|
||||
platforms: linux/amd64
|
||||
file: docker/Dockerfile
|
||||
context: target/docker/
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
file: target/docker/Dockerfile
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue