Skip to content

Build

Build #8

Workflow file for this run

name: Build
on:
workflow_dispatch:
inputs:
libraryVersion:
description: 'Library Version'
required: true
default: ''
packageVersion:
description: 'Package Version'
required: true
default: ''
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Rust
run: rustup update stable && rustup default stable
- name: Update Package Version
run: |
sed -i '0,/version =/{s/version =.*/version = "${{ github.event.inputs.packageVersion }}"/;}' Cargo.toml
- name: Commit, Tag and Push
run: |
git add Cargo.toml
git config user.name github-actions
git config user.email github-actions@github.com
git commit -m "chore(package version): updated version" | exit 0
git tag ${{ github.event.inputs.packageVersion }}
git push & git push --tags
- name: Update Library Version in download script
run: |
sed -i '/VERSION=/!b;cVERSION=\"v${{ github.event.inputs.libraryVersion }}";' ./download-libs.sh
- name: Download libraries
run: |
./download-libs.sh
- name: Build
run: |
cargo build --verbose
- name: Publish
# --allow-dirty is set here as a workaround because changes cannot be committed to a protected branch
run: |
cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --allow-dirty