Skip to content

fix version ranges in example crates #11

fix version ranges in example crates

fix version ranges in example crates #11

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: auth
run: |
git config --global user.name "release"
git config --global user.email "release@release.release"
- name: rust version
run: rustc -V
- name: extract branch from tag
id: extract_branch
run: |
BRANCH=$( git log -1 --format='%D' ${{ github.ref_name }} | grep -oP 'origin/\K.*' )
echo "BRANCH=$BRANCH" >> $GITHUB_OUTPUT
- name: print branch
run: echo ${{ steps.extract_branch.outputs.BRANCH }}
- name: switch to branch
run: git switch ${{ steps.extract_branch.outputs.BRANCH }}
- name: prepare relib crate
run: |
chmod +x ./scripts/build_relib_crate.sh
./scripts/build_relib_crate.sh
git add .
git commit --allow-empty -m "relib files"
- name: cargo login
run: cargo login ${{ secrets.CRATES_IO_TOKEN }}
- name: extract version from tag
id: extract_version
run: |
VERSION=$( echo ${{ github.ref_name }} | grep -oP 'v\K.*' )
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: print version
run: echo ${{ steps.extract_version.outputs.VERSION }}
- name: install cargo-binstall
uses: cargo-bins/cargo-binstall@v1.10.12
- name: install cargo-release
run: |
cargo binstall cargo-release@=0.25.13 --no-confirm
- name: cargo release
run: |
cargo release ${{ steps.extract_version.outputs.VERSION }} --no-confirm --no-push --execute
- name: update Cargo.lock of examples
run: |
cd examples/abi_stable_usage
cargo check
cd ../custom_global_alloc
cargo check
cd ../live_reload
cargo check
cd ../export_main_macro
cargo check
# reset two commits: by cargo-release and "relib files" one and after that merge them in new one
- name: patch release commit
run: |
git reset HEAD~2
git add .
git commit -m "v${{ steps.extract_version.outputs.VERSION }}"
git push