Skip to content

some stuff

some stuff #7

Workflow file for this run

name: Release (Rust)
on:
push:
tags:
- 'rs/v*'
jobs:
release:
name: Release
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Extract Release Version
id: extract_release_version
run: |
RELEASE_TAG=${GITHUB_REF#refs/tags/}
RELEASE_VERSION=${RELEASE_TAG#rs/v}
if [[ ! $RELEASE_VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "'$VERSION' is not a valid semver version"
exit 1
fi
echo "release_version=$RELEASE_VERSION" >> $GITHUB_OUTPUT
- name: Say Hi
run: |
echo "We are about to release: ${{ steps.extract_release_version.outputs.release_version }}"
- name: Update Workspace Dependencies
run: |
cargo update
- name: Set Workspace Version
run: |
sed -i "s/^version = \".*\"/version = \"${{ steps.extract_release_version.outputs.release_version }}\"/" Cargo.toml
- name: Run Tests
run: |
cargo test
- name: Commit Changes
run: |
git checkout -b releases/rs/v${{ steps.extract_release_version.outputs.release_version }}
git add Cargo.toml
git add Cargo.lock
git commit -m "build: update version to v${{ steps.extract_release_version.outputs.release_version }}"
git push origin releases/rs/v${{ steps.extract_release_version.outputs.release_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}