Skip to content

Bump to v0.2.15

Bump to v0.2.15 #21

Workflow file for this run

name: Deploy
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
docker:
name: Build Docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v5
with:
tags: ghcr.io/bbaovanc/bobashare:latest
push: true
create-empty-release:
name: Create empty draft release
runs-on: ubuntu-latest
steps:
# create the release once, first
# otherwise two releases could finish building simultaneously and create two of the new release
- name: Draft release
uses: softprops/[email protected]
with:
draft: true
release:
needs: create-empty-release
strategy:
fail-fast: false
matrix:
build:
# we do not need a gnu one because rust's musl is statically linked by default
# use_clang: needs to be specified when onig_sys needs to compile libonig
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
- os: ubuntu-latest
target: arm-unknown-linux-musleabihf
- os: ubuntu-latest
target: armv7-unknown-linux-musleabihf
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
- os: windows-latest
target: x86_64-pc-windows-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
name: Draft release
runs-on: ${{ matrix.build.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version name
id: version
# thanks windows
shell: bash
run: |
echo "VERSION=$(git describe --tags --dirty)" >> $GITHUB_OUTPUT
- name: Install target on host
if: ${{ matrix.build.os != 'ubuntu-latest' }}
run: |
rustup target add ${{ matrix.build.target }}
- uses: cargo-bins/[email protected]
if: ${{ matrix.build.os == 'ubuntu-latest' }}
- name: Install cross-rs
if: ${{ matrix.build.os == 'ubuntu-latest' }}
run: cargo binstall cross
- name: Set cargo command to cargo
shell: bash
if: ${{ matrix.build.os != 'ubuntu-latest' }}
run: echo cargo_cmd=cargo >> $GITHUB_ENV
- name: Set cargo command to cross
shell: bash
if: ${{ matrix.build.os == 'ubuntu-latest' }}
run: echo cargo_cmd=cross >> $GITHUB_ENV
# need env.cargo_cmd instead of just $cargo_cmd because windows shell
- name: Build
run: |
${{ env.cargo_cmd }} build --target ${{ matrix.build.target }} --release --locked
- name: Rename binaries (Unix)
if: ${{ matrix.build.os == 'ubuntu-latest' || matrix.build.os == 'macos-latest' }}
run: |
mv target/${{ matrix.build.target }}/release/bobashare-admin target/${{ matrix.build.target }}/release/bobashare-admin-${{ steps.version.outputs.VERSION }}-${{ matrix.build.target }}
mv target/${{ matrix.build.target }}/release/bobashare-web target/${{ matrix.build.target }}/release/bobashare-web-${{ steps.version.outputs.VERSION }}-${{ matrix.build.target }}
- name: Rename binaries (Windows)
if: ${{ matrix.build.os == 'windows-latest' }}
run: |
mv target/${{ matrix.build.target }}/release/bobashare-admin.exe target/${{ matrix.build.target }}/release/bobashare-admin-${{ steps.version.outputs.VERSION }}-${{ matrix.build.target }}.exe
mv target/${{ matrix.build.target }}/release/bobashare-web.exe target/${{ matrix.build.target }}/release/bobashare-web-${{ steps.version.outputs.VERSION }}-${{ matrix.build.target }}.exe
- name: Draft release
uses: softprops/[email protected]
with:
draft: true
files: |
target/${{ matrix.build.target }}/release/bobashare-admin-*
target/${{ matrix.build.target }}/release/bobashare-web-*