ci: create github release

if the new release-operator detects that a release pull-request has been
merged. that would be a pull-request tagged with the label 'release' and
with a commit message that contains the semver version in the first
line, e.g. 'release v0.5.1'
This commit is contained in:
Hendrik Maus 2022-03-24 08:27:17 +01:00
parent ab623cccfc
commit f2c7b05f28
No known key found for this signature in database
GPG Key ID: B6BAE8C6AA47DA8C

View File

@ -73,3 +73,57 @@ jobs:
with: with:
name: ${{ env.PROJ_NAME }}-${{ matrix.target }}.exe name: ${{ env.PROJ_NAME }}-${{ matrix.target }}.exe
path: ${{ env.PROJ_NAME }}-${{ matrix.target }}.exe path: ${{ env.PROJ_NAME }}-${{ matrix.target }}.exe
release:
name: Release
needs: binaries
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Toolchain
uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
toolchain: stable
- name: Operator | Cache
uses: Swatinem/rust-cache@v1
with:
key: release-operator-01
working-directory: ./release-operator
- name: Operator | Deduce
id: release
working-directory: ./release-operator
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_LABEL: release
RUST_LOG: info
run: |
# Run release operator
cargo run
- name: Binaries | Download
if: ${{ steps.release.outputs.release-detected == 'true' }}
uses: actions/download-artifact@v3
- name: Binaries | Checksums
if: ${{ steps.release.outputs.release-detected == 'true' }}
run: |
# Build binary checksums
for file in "${PROJ_NAME}"-*/"${PROJ_NAME}"-*; do
echo "Calculating checksum for: $(basename "${file}")"
openssl dgst -sha256 -r "${file}" \
| awk '{print $1}' > "${file}.sha256"
done
- name: Create GitHub Release
if: ${{ steps.release.outputs.release-detected == 'true' }}
uses: softprops/action-gh-release@v0.1.14
with:
tag_name: ${{ steps.release.outputs.tag-name }}
name: ${{ steps.release.outputs.tag-name }}
files: ${{ env.PROJ_NAME }}-*/${{ env.PROJ_NAME }}-*