Only add https:// if not present #116
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
branches: [ "main" ] | |
tags: 'v*' | |
paths-ignore: | |
- 'doc/**' | |
- '.github/**' | |
- 'README.md' | |
- 'LICENSE' | |
- '.gitignore' | |
- 'CONTRIBUTING' | |
workflow_dispatch: | |
jobs: | |
coverage: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup rust stable | |
run: curl https://sh.rustup.rs -sSf | sh -s -- -y && cargo install cargo-tarpaulin | |
- name: unit tests with coverage | |
run: cargo build --release && cargo tarpaulin --out json --coveralls ${{ secrets.COVERALLS_API_KEY }} --exclude-files tests/** | |
build_test_and_bundle: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, ubuntu-20.04, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup rust stable | |
run: curl https://sh.rustup.rs -sSf | sh -s -- -y | |
- name: unit tests | |
run: | | |
cargo test --all --release | |
- name: bundle | |
shell: bash | |
run: | | |
mkdir Busser | |
cp target/release/busser Busser/busser-${{ matrix.os }} | |
cp LICENSE Busser/ | |
- name: upload bundle | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.os }} | |
path: Busser | |
build_test_and_bundle_arm: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup rust stable | |
run: | | |
curl https://sh.rustup.rs -sSf | sh -s -- -y | |
rustup target add armv7-unknown-linux-gnueabi | |
rustup target add aarch64-unknown-linux-gnu | |
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi | |
- name: unit tests | |
run: | | |
cargo build --release --target armv7-unknown-linux-gnueabi | |
cargo build --release --target aarch64-unknown-linux-gnu | |
- name: bundle | |
shell: bash | |
run: | | |
mkdir Busser-armv7 | |
cp target/armv7-unknown-linux-gnueabi/release/busser Busser-armv7/busser-armv7 | |
cp LICENSE Busser-armv7/ | |
mkdir Busser-aarch64 | |
cp target/aarch64-unknown-linux-gnu/release/busser Busser-aarch64/busser-aarch64 | |
cp LICENSE Busser-aarch64/ | |
- name: upload bundle | |
uses: actions/upload-artifact@v4 | |
with: | |
name: armv7 | |
path: Busser-armv7 | |
- name: upload bundle | |
uses: actions/upload-artifact@v4 | |
with: | |
name: aarch64 | |
path: Busser-aarch64 | |
release: | |
needs: [build_test_and_bundle, build_test_and_bundle_arm] | |
if: github.ref_type == 'tag' | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: get linux build | |
uses: actions/download-artifact@v4 | |
with: | |
name: ubuntu-20.04 | |
- name: get windows build | |
uses: actions/download-artifact@v4 | |
with: | |
name: windows-latest | |
- name: get macos build | |
uses: actions/download-artifact@v4 | |
with: | |
name: macos-latest | |
- name: get armv7 build | |
uses: actions/download-artifact@v4 | |
with: | |
name: armv7 | |
- name: get aarch64 build | |
uses: actions/download-artifact@v4 | |
with: | |
name: aarch64 | |
- name: pack | |
run: | | |
mkdir linux windows macos armv7 aarch64 | |
ls | |
mv busser-ubuntu-20.04 busser-linux-x86_64 | |
for arch in linux-x86_64 macos-latest armv7 aarch64; do mv busser-$arch busser && chmod +x busser && tar -cvf busser-$arch.tar.gz busser LICENSE; done | |
mv busser-macos-latest.tar.gz busser-macOS.tar.gz | |
mv busser-windows-latest.exe busser.exe | |
chmod +x busser.exe | |
zip busser-windows.zip busser.exe LICENSE | |
ls | |
# https://github.com/softprops/action-gh-release | |
- name: release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
prerelease: true | |
name: "release-${{ github.ref_name }}" | |
tag_name: ${{ github.ref }} | |
files: | | |
busser-linux-x86_64.tar.gz | |
busser-windows.zip | |
busser-macOS.tar.gz | |
busser-armv7.tar.gz | |
busser-aarch64.tar.gz |