-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef90182
commit ce4ce29
Showing
1 changed file
with
15 additions
and
53 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,63 +6,25 @@ on: | |
- "v*" | ||
|
||
jobs: | ||
build: | ||
name: Build and Release | ||
runs-on: ${{ matrix.os }} | ||
release: | ||
name: release ${{ matrix.target }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
extension: "" | ||
- os: windows-latest | ||
extension: ".exe" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# - name: Set up Rust | ||
# uses: actions-rs/toolchain@v1 | ||
# with: | ||
# toolchain: stable | ||
# profile: minimal | ||
# override: true | ||
- name: Build Release | ||
run: cargo build --release | ||
- name: Archive Release (Linux) | ||
if: runner.os == 'Linux' | ||
run: | | ||
zip -j find-pep-${{ matrix.os }}.zip target/release/find-pep${{ matrix.extension }} | ||
- name: Archive Release (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
Compress-Archive -Path target/release/find-pep${{ matrix.extension }} -DestinationPath find-pep-${{ matrix.os }}.zip | ||
shell: pwsh | ||
- name: Upload Release Asset | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: find-pep-${{ matrix.os }}.zip | ||
path: find-pep-${{ matrix.os }}.zip | ||
|
||
release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
- target: x86_64-pc-windows-gnu | ||
archive: zip | ||
- target: x86_64-unknown-linux-musl | ||
archive: zip | ||
- target: x86_64-apple-darwin | ||
archive: zip | ||
steps: | ||
- name: Download Artifacts | ||
uses: actions/download-artifact@v4 | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
- name: Upload Release Assets | ||
uses: actions/upload-release-asset@v1 | ||
- uses: actions/checkout@master | ||
- name: Compile and release | ||
uses: rust-build/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./*.zip | ||
asset_name: find-pep-${{ runner.os }}.zip | ||
asset_content_type: application/zip | ||
RUSTTARGET: ${{ matrix.target }} | ||
ARCHIVE_TYPES: ${{ matrix.archive }} |