Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump actions #7

Merged
merged 1 commit into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading