Workflow file for this run
This file contains hidden or 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 | ||
Check failure on line 1 in .github/workflows/build_release.yml
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
jobs: | ||
create_related_repo_tags: | ||
runs-on: ubuntu-latest | ||
if: ${{ vars.APP_ID && secrets.APP_PRIVATE_KEY }} | ||
steps: | ||
- name: Generate GitHub App token | ||
id: app-token | ||
uses: actions/create-github-app-token@v2 | ||
with: | ||
app-id: ${{ vars.APP_ID }} | ||
private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||
repositories: cedar-spec,cedar-integration-tests | ||
- name: Create tag in cedar-spec | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ steps.app-token.outputs.token }} | ||
script: | | ||
const tag = context.ref.replace('refs/tags/', ''); | ||
const version = tag.replace('v', ''); | ||
const [major, minor, _] = version.split('.'); | ||
const releaseBranch = `release/${major}.${minor}.x`; | ||
await github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: 'cedar-spec', | ||
ref: `refs/tags/${tag}`, | ||
sha: (await github.rest.repos.getBranch({ | ||
owner: context.repo.owner, | ||
repo: 'cedar-spec', | ||
branch: releaseBranch | ||
})).data.commit.sha | ||
}); | ||
- name: Create tag in cedar-integration-tests | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ steps.app-token.outputs.token }} | ||
script: | | ||
const tag = context.ref.replace('refs/tags/', ''); | ||
const version = tag.replace('v', ''); | ||
const [major, minor, _] = version.split('.'); | ||
const releaseBranch = `release/${major}.${minor}.x`; | ||
await github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: 'cedar-integration-tests', | ||
ref: `refs/tags/${tag}`, | ||
sha: (await github.rest.repos.getBranch({ | ||
owner: context.repo.owner, | ||
repo: 'cedar-integration-tests', | ||
branch: releaseBranch | ||
})).data.commit.sha | ||
}); | ||
build_release_binaries: | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- os: macos-13 | ||
target: x86_64-apple-darwin | ||
- os: macos-latest | ||
target: aarch64-apple-darwin | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust toolchain | ||
run: rustup update stable && rustup default stable | ||
- name: Install protobuf (Ubuntu) | ||
if: matrix.os == 'ubuntu-latest' | ||
run: sudo apt-get update && sudo apt-get install protobuf-compiler | ||
- name: Install protobuf (macOS) | ||
if: startsWith(matrix.os, 'macos') | ||
run: brew install protobuf | ||
- name: Build release binaries | ||
run: cargo build --release --all-features | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cedar-${{matrix.target}} | ||
path: ./target/release/cedar |