Skip to content

Release 2.7.0

Release 2.7.0 #14

Workflow file for this run

name: Release on tag
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: moonrepo/setup-rust@v0
with:
cache-target: release
bins: cargo-workspaces
- name: Build
run: cargo build --release
- name: Publish package
run: cargo workspaces publish --from-git
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Create a draft release
id: create_release
run: |
NEW_VERSION=$(cargo workspaces ls --json | jq -r '.[] | select(.name == "codspeed") | .version')
gh release create v$NEW_VERSION --title "v$NEW_VERSION" --generate-notes -d
echo "upload_url=$(gh release view v$NEW_VERSION --json uploadUrl | jq -r '.uploadUrl')" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
build-upload-binaries:
needs: publish
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: moonrepo/setup-rust@v0
with:
targets: ${{ matrix.target }}
cache-target: ${{ matrix.target }}/release
# TODO: Reenable when we have a way to build for other targets
# - name: Setup environment for target
# if: ${{ matrix.setup }}
# run: ${{ matrix.setup }}
- run: cargo build --release --features vendored-openssl --bin cargo-codspeed --target ${{ matrix.target }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.publish.outputs.upload_url }}
asset_path: ./target/${{ matrix.target }}/release/cargo-codspeed
asset_name: cargo-codspeed-${{ matrix.target }}
asset_content_type: application/octet-stream