|
@ -14,10 +14,6 @@ jobs: |
|
|
target: x86_64-unknown-linux-gnu |
|
|
target: x86_64-unknown-linux-gnu |
|
|
os: ubuntu-latest |
|
|
os: ubuntu-latest |
|
|
archive_ext: tar |
|
|
archive_ext: tar |
|
|
- bin: taker |
|
|
|
|
|
target: armv7-unknown-linux-gnueabihf |
|
|
|
|
|
os: ubuntu-latest |
|
|
|
|
|
archive_ext: tar |
|
|
|
|
|
- bin: taker |
|
|
- bin: taker |
|
|
target: aarch64-unknown-linux-gnu |
|
|
target: aarch64-unknown-linux-gnu |
|
|
os: ubuntu-latest |
|
|
os: ubuntu-latest |
|
@ -26,18 +22,10 @@ jobs: |
|
|
target: x86_64-apple-darwin |
|
|
target: x86_64-apple-darwin |
|
|
os: macos-latest |
|
|
os: macos-latest |
|
|
archive_ext: tar |
|
|
archive_ext: tar |
|
|
- bin: taker |
|
|
|
|
|
target: x86_64-pc-windows-msvc |
|
|
|
|
|
os: windows-latest |
|
|
|
|
|
archive_ext: zip |
|
|
|
|
|
- bin: maker |
|
|
- bin: maker |
|
|
target: x86_64-unknown-linux-gnu |
|
|
target: x86_64-unknown-linux-gnu |
|
|
os: ubuntu-latest |
|
|
os: ubuntu-latest |
|
|
archive_ext: tar |
|
|
archive_ext: tar |
|
|
- bin: maker |
|
|
|
|
|
target: armv7-unknown-linux-gnueabihf |
|
|
|
|
|
os: ubuntu-latest |
|
|
|
|
|
archive_ext: tar |
|
|
|
|
|
- bin: maker |
|
|
- bin: maker |
|
|
target: aarch64-unknown-linux-gnu |
|
|
target: aarch64-unknown-linux-gnu |
|
|
os: ubuntu-latest |
|
|
os: ubuntu-latest |
|
@ -46,10 +34,6 @@ jobs: |
|
|
target: x86_64-apple-darwin |
|
|
target: x86_64-apple-darwin |
|
|
os: macos-latest |
|
|
os: macos-latest |
|
|
archive_ext: tar |
|
|
archive_ext: tar |
|
|
- bin: maker |
|
|
|
|
|
target: x86_64-pc-windows-msvc |
|
|
|
|
|
os: windows-latest |
|
|
|
|
|
archive_ext: zip |
|
|
|
|
|
runs-on: ${{ matrix.os }} |
|
|
runs-on: ${{ matrix.os }} |
|
|
steps: |
|
|
steps: |
|
|
- name: Checkout tagged commit |
|
|
- name: Checkout tagged commit |
|
@ -65,12 +49,6 @@ jobs: |
|
|
with: |
|
|
with: |
|
|
key: ${{ matrix.target }} |
|
|
key: ${{ matrix.target }} |
|
|
|
|
|
|
|
|
- name: Install compiler for armhf arch |
|
|
|
|
|
if: matrix.target == 'armv7-unknown-linux-gnueabihf' |
|
|
|
|
|
run: | |
|
|
|
|
|
sudo apt-get update |
|
|
|
|
|
sudo apt-get install gcc-arm-linux-gnueabihf |
|
|
|
|
|
|
|
|
|
|
|
- name: Install compiler for aarch64 arch (armv8) |
|
|
- name: Install compiler for aarch64 arch (armv8) |
|
|
if: matrix.target == 'aarch64-unknown-linux-gnu' |
|
|
if: matrix.target == 'aarch64-unknown-linux-gnu' |
|
|
run: | |
|
|
run: | |
|
@ -95,8 +73,8 @@ jobs: |
|
|
run: cargo build --target=${{ matrix.target }} --release --bin ${{ matrix.bin }} |
|
|
run: cargo build --target=${{ matrix.target }} --release --bin ${{ matrix.bin }} |
|
|
|
|
|
|
|
|
- name: Smoke test the binary |
|
|
- name: Smoke test the binary |
|
|
# armv7-* and aarch64-* is only cross-compiled, no smoke test |
|
|
# aarch64-* is only cross-compiled, no smoke test |
|
|
if: matrix.target != 'armv7-unknown-linux-gnueabihf' && matrix.target != 'aarch64-unknown-linux-gnu' |
|
|
if: matrix.target != 'aarch64-unknown-linux-gnu' |
|
|
run: target/${{ matrix.target }}/release/${{ matrix.bin }} --help |
|
|
run: target/${{ matrix.target }}/release/${{ matrix.bin }} --help |
|
|
|
|
|
|
|
|
# Remove once python 3 is the default |
|
|
# Remove once python 3 is the default |
|
@ -105,7 +83,7 @@ jobs: |
|
|
python-version: '3.x' |
|
|
python-version: '3.x' |
|
|
|
|
|
|
|
|
- id: create-archive-name |
|
|
- id: create-archive-name |
|
|
shell: python # Use python to have a prettier name for the archive on Windows. |
|
|
shell: python # Use python to have a prettier name for the archive. |
|
|
run: | |
|
|
run: | |
|
|
import platform |
|
|
import platform |
|
|
os_info = platform.uname() |
|
|
os_info = platform.uname() |
|
@ -129,13 +107,6 @@ jobs: |
|
|
shell: bash |
|
|
shell: bash |
|
|
run: tar -C ./target/${{ matrix.target }}/release --create --file=${{ steps.create-archive-name.outputs.archive }} ${{ matrix.bin }} |
|
|
run: tar -C ./target/${{ matrix.target }}/release --create --file=${{ steps.create-archive-name.outputs.archive }} ${{ matrix.bin }} |
|
|
|
|
|
|
|
|
- name: Pack windows archive |
|
|
|
|
|
if: matrix.os == 'windows-latest' |
|
|
|
|
|
shell: bash |
|
|
|
|
|
run: | |
|
|
|
|
|
cp target/${{ matrix.target }}/release/${{ matrix.bin }}.exe ./${{ matrix.bin }}.exe |
|
|
|
|
|
7z a -tzip ${{ steps.create-archive-name.outputs.archive }} ./${{ matrix.bin }}.exe |
|
|
|
|
|
|
|
|
|
|
|
- name: Upload archive |
|
|
- name: Upload archive |
|
|
uses: actions/upload-release-asset@v1.0.2 |
|
|
uses: actions/upload-release-asset@v1.0.2 |
|
|
env: |
|
|
env: |
|
@ -181,7 +152,7 @@ jobs: |
|
|
|
|
|
|
|
|
- name: Download release from github |
|
|
- name: Download release from github |
|
|
run: | |
|
|
run: | |
|
|
gh release download ${{ github.event.release.tag_name }} -p '${{matrix.bin}}*Linux_x86_64*' -p '${{matrix.bin}}*aarch64*' -p '${{matrix.bin}}*armv7*' |
|
|
gh release download ${{ github.event.release.tag_name }} -p '${{matrix.bin}}*Linux_x86_64*' -p '${{matrix.bin}}*aarch64*' |
|
|
|
|
|
|
|
|
- name: Unpack archives |
|
|
- name: Unpack archives |
|
|
run: | |
|
|
run: | |
|
@ -189,13 +160,14 @@ jobs: |
|
|
# |
|
|
# |
|
|
# By providing `platform` to `docker buildx` the variable `TARGETPLATFORM` will be available |
|
|
# By providing `platform` to `docker buildx` the variable `TARGETPLATFORM` will be available |
|
|
# when building the image. This variable is either |
|
|
# when building the image. This variable is either |
|
|
# `linux/amd64/`, `linux/arm64/` or `linux/arm/v7`. Hence we need to extract into subfolders. |
|
|
# `linux/amd64/`, `linux/arm64/`. Hence we need to extract into subfolders. |
|
|
|
|
|
|
|
|
7z x ${{matrix.bin}}_${{ github.event.release.tag_name }}_Linux_aarch64.tar -olinux/arm64/ |
|
|
7z x ${{matrix.bin}}_${{ github.event.release.tag_name }}_Linux_aarch64.tar -olinux/arm64/ |
|
|
|
|
|
|
|
|
7z x ${{matrix.bin}}_${{ github.event.release.tag_name }}_Linux_x86_64.tar -olinux/amd64/ |
|
|
7z x ${{matrix.bin}}_${{ github.event.release.tag_name }}_Linux_x86_64.tar -olinux/amd64/ |
|
|
|
|
|
|
|
|
7z x ${{matrix.bin}}_${{ github.event.release.tag_name }}_Linux_armv7.tar -olinux/arm/v7 |
|
|
chmod a+x linux/amd64/* |
|
|
|
|
|
chmod a+x linux/arm64/* |
|
|
|
|
|
|
|
|
- name: Build docker image for ${{matrix.bin}} |
|
|
- name: Build docker image for ${{matrix.bin}} |
|
|
run: | |
|
|
run: | |
|
@ -207,7 +179,7 @@ jobs: |
|
|
|
|
|
|
|
|
docker buildx build \ |
|
|
docker buildx build \ |
|
|
--push \ |
|
|
--push \ |
|
|
--platform linux/amd64,linux/arm64,linux/arm/v7 \ |
|
|
--platform linux/amd64,linux/arm64 \ |
|
|
--label "org.opencontainers.image.source https://github.com/${{ github.repository }}" \ |
|
|
--label "org.opencontainers.image.source https://github.com/${{ github.repository }}" \ |
|
|
--tag ghcr.io/${{ github.repository }}/${{matrix.bin}}:${VERSION} \ |
|
|
--tag ghcr.io/${{ github.repository }}/${{matrix.bin}}:${VERSION} \ |
|
|
--build-arg BINARY_PATH=${{matrix.bin}} \ |
|
|
--build-arg BINARY_PATH=${{matrix.bin}} \ |
|
|