trying to fix release again #13
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: Release | |
on: | |
push: | |
tags: | |
- "*.*.*" | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
# Build for Linux | |
- name: Build (Linux) | |
working-directory: seedelf-cli | |
run: cargo build --release | |
# Generate checksum (Linux) | |
- name: Generate checksum (Linux) | |
working-directory: seedelf-cli | |
run: sha256sum target/release/seedelf-cli > seedelf-cli-linux.sha256 | |
# Create a GitHub Release | |
- name: Create GitHub Release | |
id: create_github_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.ref_name }} | |
body: "Automated release of seedelf-cli." | |
- name: Upload Linux Binary | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_github_release.outputs.upload_url }} | |
asset_path: seedelf-cli/target/release/seedelf-cli | |
asset_name: seedelf-cli-linux | |
asset_content_type: application/octet-stream | |
- name: Upload Linux Checksum | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_github_release.outputs.upload_url }} | |
asset_path: seedelf-cli/seedelf-cli-linux.sha256 | |
asset_name: seedelf-cli-linux.sha256 | |
asset_content_type: text/plain | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Check out the code | |
uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
# Build for Windows | |
- name: Build (Windows) | |
working-directory: seedelf-cli | |
run: cargo build --release --target x86_64-pc-windows-gnu | |
- name: Generate checksum (Windows) | |
shell: pwsh | |
working-directory: seedelf-cli | |
run: | | |
$hash = Get-FileHash target\x86_64-pc-windows-gnu\release\seedelf-cli.exe -Algorithm SHA256 | |
$hash.Hash | Out-File -Encoding ASCII seedelf-cli-windows.sha256 | |
# Update the existing GitHub Release (the release is already created by the linux job) | |
- name: Update GitHub Release with Windows Assets | |
id: update_github_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.ref_name }} | |
# Optional: if you don't provide a body here, it won't overwrite the previous body. | |
# body: "Windows build of seedelf-cli added." | |
- name: Upload Windows Binary | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.update_github_release.outputs.upload_url }} | |
asset_path: seedelf-cli/target/x86_64-pc-windows-gnu/release/seedelf-cli.exe | |
asset_name: seedelf-cli-windows.exe | |
asset_content_type: application/octet-stream | |
- name: Upload Windows Checksum | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.update_github_release.outputs.upload_url }} | |
asset_path: seedelf-cli/seedelf-cli-windows.sha256 | |
asset_name: seedelf-cli-windows.sha256 | |
asset_content_type: text/plain |