Skip to content

Commit

Permalink
Merge pull request #7 from mtsmfm/bump-actions
Browse files Browse the repository at this point in the history
Bump actions
  • Loading branch information
mtsmfm authored Jan 19, 2025
2 parents 45ee4d4 + 0b42da8 commit edbaa44
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 19 deletions.
49 changes: 35 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
tags:
- "v*"
pull_request:
branches: [main]

jobs:
build:
Expand All @@ -13,30 +15,48 @@ jobs:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-pc-windows-gnu
os: ubuntu-latest
os: windows-latest
extension: .exe
- target: x86_64-apple-darwin
os: macos-latest

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --target=${{ matrix.target }}
use-cross: true
- uses: actions/upload-artifact@v1
targets: ${{ matrix.target }}
- run: cargo build --release --target=${{ matrix.target }}
- uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.target }}
path: target/${{ matrix.target }}/release/split-test${{ matrix.extension }}

create-release:
test-artifact:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-pc-windows-gnu
os: windows-latest
extension: .exe
- target: x86_64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
needs: [build]
steps:
- uses: actions/download-artifact@v4
with:
name: build-${{ matrix.target }}
- run: chmod +x ./split-test${{ matrix.extension }}
- run: ./split-test${{ matrix.extension }} --help

create-release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [test-artifact]
runs-on: ubuntu-latest
steps:
- id: create-release
Expand All @@ -50,12 +70,13 @@ jobs:
prerelease: false
- run: |
echo '${{ steps.create-release.outputs.upload_url }}' > release_upload_url.txt
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
with:
name: create-release
path: release_upload_url.txt

upload-release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
strategy:
matrix:
target:
Expand All @@ -67,13 +88,13 @@ jobs:
needs: [create-release]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v1
- uses: actions/download-artifact@v4
with:
name: create-release
- id: upload-url
run: |
echo "::set-output name=url::$(cat create-release/release_upload_url.txt)"
- uses: actions/download-artifact@v1
echo "url=$(cat create-release/release_upload_url.txt)" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v4
with:
name: build-${{ matrix.target }}
- run: find .
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: actions-rs/cargo@v1
with:
command: test
- run: cargo test

0 comments on commit edbaa44

Please sign in to comment.