Update crates and bump MSRV #3
Workflow file for this run
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: 'Create Github Release' | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
release: | |
name: 'Create Github Release' | |
runs-on: 'ubuntu-latest' | |
steps: | |
- name: 'Checkout' | |
uses: 'actions/checkout@v2' | |
with: | |
fetch-depth: 1 | |
- name: 'Install Toolchain' | |
uses: 'actions-rs/toolchain@v1' | |
with: | |
profile: 'minimal' | |
toolchain: 'stable' | |
override: true | |
- name: 'Package Crate' | |
uses: 'actions-rs/cargo@v1' | |
with: | |
command: 'publish' | |
args: '--dry-run' | |
- name: 'Rename Crate to tar.gz' | |
id: 'rename_crate' | |
run: | | |
CRATE_NAME="s3du" | |
STRIPPED_VERSION="$(basename ${{ github.ref }} | tr -d v)" | |
RELEASE="${CRATE_NAME}-${STRIPPED_VERSION}" | |
ASSET_DIR="target/package" | |
ASSET_NAME="${RELEASE}.tar.gz" | |
ASSET_PATH="${ASSET_DIR}/${ASSET_NAME}" | |
cd "${ASSET_DIR}" | |
mv "${RELEASE}.crate" "${ASSET_NAME}" | |
echo "::set-output name=asset_name::${ASSET_NAME}" | |
echo "::set-output name=asset_path::${ASSET_PATH}" | |
- name: 'Generate Release Changelog' | |
id: 'generate_changelog' | |
run: | | |
VERSION="$(basename ${{ github.ref }})" | |
OUTPUT="release_changelog.md" | |
# Add changelog for version | |
sed -n "/^## ${VERSION}/,/^##/p;" CHANGELOG.md \ | |
| sed '$ d' \ | |
> "${OUTPUT}" | |
# Add all links | |
sed -n "/^<\!-- links -->/,//p;" CHANGELOG.md \ | |
>> "${OUTPUT}" | |
echo "::set-output name=body_path::${OUTPUT}" | |
- name: 'Create Release' | |
id: 'create_release' | |
uses: 'actions/create-release@v1' | |
env: | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
with: | |
body_path: '${{ steps.generate_changelog.outputs.body_path }}' | |
draft: false | |
prerelease: false | |
release_name: 'Release ${{ github.ref }}' | |
tag_name: '${{ github.ref }}' | |
- name: 'Upload Release Asset' | |
id: 'upload-release-asset' | |
uses: 'actions/upload-release-asset@v1' | |
env: | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
with: | |
asset_content_type: 'application/octet-stream' | |
asset_name: '${{ steps.rename_crate.outputs.asset_name }}' | |
asset_path: '${{ steps.rename_crate.outputs.asset_path }}' | |
upload_url: '${{ steps.create_release.outputs.upload_url }}' |