Skip to content

ci: test before release (#4) #18

ci: test before release (#4)

ci: test before release (#4) #18

Workflow file for this run

name: Semantic Release
on:
push:
branches:
- main
- beta
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests
run: cargo test
release:
runs-on: ubuntu-latest
needs:
- test
steps:
- name: "☁️ checkout repository"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "🔧 setup Bun"
uses: oven-sh/setup-bun@v1
- name: "📦 install dependencies"
run: bun install -D @semantic-release/git conventional-changelog-conventionalcommits semantic-release-cargo
- name: Get Author Name and Email
run: |
AUTHOR_NAME=$(git log -1 --pretty=format:%an ${{ github.sha }})
AUTHOR_EMAIL=$(git log -1 --pretty=format:%ae ${{ github.sha }})
echo "AUTHOR_NAME=$AUTHOR_NAME" >> $GITHUB_OUTPUT
echo "AUTHOR_EMAIL=$AUTHOR_EMAIL" >> $GITHUB_OUTPUT
id: author_info
- name: "Semantic release🚀"
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_TOKEN }}
GIT_COMMITTER_NAME: "github-actions[bot]"
GIT_COMMITTER_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com"
GIT_AUTHOR_NAME: ${{ steps.author_info.outputs.AUTHOR_NAME }}
GIT_AUTHOR_EMAIL: ${{ steps.author_info.outputs.AUTHOR_EMAIL }}
run: |
bun x semantic-release