mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
28937b8693
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.2. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4.1.1...v4.1.2) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
117 lines
3.9 KiB
YAML
117 lines
3.9 KiB
YAML
name: "Build swap and asb release binaries"
|
|
|
|
on:
|
|
release:
|
|
types: [created]
|
|
|
|
jobs:
|
|
build_binaries:
|
|
name: Build swap and asb binaries
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- bin: swap
|
|
target: x86_64-unknown-linux-gnu
|
|
os: ubuntu-latest
|
|
archive_ext: tar
|
|
- bin: swap
|
|
target: armv7-unknown-linux-gnueabihf
|
|
os: ubuntu-latest
|
|
archive_ext: tar
|
|
- bin: swap
|
|
target: x86_64-apple-darwin
|
|
os: macos-latest
|
|
archive_ext: tar
|
|
- bin: swap
|
|
target: x86_64-pc-windows-msvc
|
|
os: windows-latest
|
|
archive_ext: zip
|
|
- bin: asb
|
|
target: x86_64-unknown-linux-gnu
|
|
os: ubuntu-latest
|
|
archive_ext: tar
|
|
- bin: asb
|
|
target: armv7-unknown-linux-gnueabihf
|
|
os: ubuntu-latest
|
|
archive_ext: tar
|
|
- bin: asb
|
|
target: x86_64-apple-darwin
|
|
os: macos-latest
|
|
archive_ext: tar
|
|
- bin: asb
|
|
target: x86_64-pc-windows-msvc
|
|
os: windows-latest
|
|
archive_ext: zip
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout tagged commit
|
|
uses: actions/checkout@v4.1.2
|
|
with:
|
|
ref: ${{ github.event.release.target_commitish }}
|
|
token: ${{ secrets.BOTTY_GITHUB_TOKEN }}
|
|
|
|
- uses: Swatinem/rust-cache@v2.7.3
|
|
|
|
- uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: "1.70"
|
|
targets: armv7-unknown-linux-gnueabihf
|
|
|
|
- name: Build ${{ matrix.target }} ${{ matrix.bin }} release binary
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: build
|
|
args: --target=${{ matrix.target }} --release --package swap --bin ${{ matrix.bin }}
|
|
use-cross: true
|
|
|
|
- name: Smoke test the binary
|
|
if: matrix.target != 'armv7-unknown-linux-gnueabihf' # armv7-unknown-linux-gnueabihf is only cross-compiled, no smoke test
|
|
run: target/${{ matrix.target }}/release/${{ matrix.bin }} --help
|
|
|
|
# Remove once python 3 is the default
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- id: create-archive-name
|
|
shell: python # Use python to have a prettier name for the archive on Windows.
|
|
run: |
|
|
import platform
|
|
os_info = platform.uname()
|
|
|
|
arch = os_info.machine
|
|
|
|
triple = "${{ matrix.target }}".split("-")
|
|
arch = triple[0]
|
|
|
|
archive_name=f'${{ matrix.bin }}_${{ github.event.release.tag_name }}_{os_info.system}_{arch}.${{ matrix.archive_ext }}'
|
|
|
|
print(f'::set-output name=archive::{archive_name}')
|
|
|
|
- name: Pack macos archive
|
|
if: matrix.os == 'macos-latest'
|
|
shell: bash
|
|
run: gtar -C ./target/${{ matrix.target }}/release --create --file=${{ steps.create-archive-name.outputs.archive }} ${{ matrix.bin }}
|
|
|
|
- name: Pack linux archive
|
|
if: matrix.os == 'ubuntu-latest'
|
|
shell: bash
|
|
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
|
|
uses: actions/upload-release-asset@v1.0.2
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.BOTTY_GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: ./${{ steps.create-archive-name.outputs.archive }}
|
|
asset_name: ${{ steps.create-archive-name.outputs.archive }}
|
|
asset_content_type: application/gzip
|