Experimental updates to release workflow
This commit is contained in:
parent
df914e68f2
commit
68f3c4fa4e
1 changed files with 33 additions and 18 deletions
51
.github/workflows/release.yaml
vendored
51
.github/workflows/release.yaml
vendored
|
|
@ -13,27 +13,43 @@ on:
|
||||||
tags:
|
tags:
|
||||||
- "v[0-9]+.[0-9]+.[0-9]+"
|
- "v[0-9]+.[0-9]+.[0-9]+"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
create_release:
|
create_release:
|
||||||
name: Create release
|
name: Create release
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
outputs:
|
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Get the release version
|
||||||
|
if: env.VERSION == ''
|
||||||
|
run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Show the version
|
||||||
|
run: |
|
||||||
|
echo "version is: $VERSION"
|
||||||
|
|
||||||
|
- name: Check that tag version and Cargo.toml version are the same
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if ! grep -q "version = \"$VERSION\"" Cargo.toml; then
|
||||||
|
echo "version does not match Cargo.toml" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Create GitHub release
|
- name: Create GitHub release
|
||||||
id: create_release
|
|
||||||
uses: actions/create-release@v1
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
run: gh release create $VERSION --draft --verify-tag --title $VERSION
|
||||||
tag_name: ${{ github.ref }}
|
|
||||||
release_name: Release ${{ github.ref }}
|
|
||||||
draft: true
|
|
||||||
|
|
||||||
release_assets:
|
outputs:
|
||||||
name: Release assets
|
version: ${{ env.VERSION }}
|
||||||
|
|
||||||
|
build_release:
|
||||||
|
name: Build all the stuff
|
||||||
needs: ['create_release'] # We need to know the upload URL
|
needs: ['create_release'] # We need to know the upload URL
|
||||||
runs-on: ${{ matrix.os }} # We run many different builds
|
runs-on: ${{ matrix.os }} # We run many different builds
|
||||||
env:
|
env:
|
||||||
|
|
@ -48,6 +64,7 @@ jobs:
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
build: ['linux', 'macos', 'arm-macos', 'windows']
|
build: ['linux', 'macos', 'arm-macos', 'windows']
|
||||||
include:
|
include:
|
||||||
|
|
@ -114,11 +131,9 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Upload release archive
|
- name: Upload release archive
|
||||||
uses: actions/upload-release-asset@v1.0.2
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
shell: bash
|
||||||
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
run: |
|
||||||
asset_name: ${{ env.ASSET }}
|
version="${{ needs.create_release.outputs.version }}"
|
||||||
asset_path: ${{ env.ASSET }}
|
gh release upload "$version" ${{ env.ASSET }}
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue