ci: configure release-plz #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release-plz | |
permissions: | |
pull-requests: write | |
contents: write | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release-plz: | |
name: Release-plz | |
runs-on: ubuntu-latest | |
if: github.repository == 'YoloDev/rkyv-utils' | |
steps: | |
# Generating a GitHub token, so that PRs and tags created by | |
# the release-plz-action can trigger actions workflows. | |
- name: Generate GitHub token | |
uses: actions/create-github-app-token@v1 | |
id: generate-token | |
with: | |
app-id: ${{ secrets.RELEASE_BOT_APP_ID }} | |
private-key: ${{ secrets.RELEASE_BOT_APP_PRIVATE_KEY }} | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ steps.generate-token.outputs.token }} | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Run sccache-cache | |
if: github.repository == 'YoloDev/rkyv-utils' | |
uses: mozilla-actions/sccache-action@v0.0.4 | |
- name: Configure sccache | |
if: github.repository == 'YoloDev/rkyv-utils' | |
shell: bash | |
run: | | |
if [[ -z "${{ secrets.SCCACHE_ENDPOINT }}" ]]; then | |
echo "SCCACHE_ENDPOINT is not set" | |
else | |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | |
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV | |
echo "SCCACHE_BUCKET=$SCCACHE_BUCKET" >> $GITHUB_ENV | |
echo "SCCACHE_REGION=$SCCACHE_REGION" >> $GITHUB_ENV | |
echo "SCCACHE_ENDPOINT=$SCCACHE_ENDPOINT" >> $GITHUB_ENV | |
echo "AWS_ACCESS_KEY_ID=$SCCACHE_ACCESS_KEY_ID" >> $GITHUB_ENV | |
echo "AWS_SECRET_ACCESS_KEY=$SCCACHE_SECRET_ACCESS_KEY" >> $GITHUB_ENV | |
fi | |
env: | |
SCCACHE_BUCKET: ${{ vars.SCCACHE_BUCKET }} | |
SCCACHE_REGION: ${{ vars.SCCACHE_REGION }} | |
SCCACHE_ENDPOINT: ${{ secrets.SCCACHE_ENDPOINT }} | |
SCCACHE_ACCESS_KEY_ID: ${{ secrets.SCCACHE_ACCESS_KEY_ID }} | |
SCCACHE_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_SECRET_ACCESS_KEY }} | |
- name: Run release-plz | |
uses: MarcoIeni/release-plz-action@v0.5 | |
env: | |
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} |