Skip to content

Commit

Permalink
Build and release new action
Browse files Browse the repository at this point in the history
  • Loading branch information
alanwilter committed Jan 17, 2024
1 parent ef90182 commit ce4ce29
Showing 1 changed file with 15 additions and 53 deletions.
68 changes: 15 additions & 53 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit ce4ce29

Please sign in to comment.