From 7d6040f4269b374b5f3b61fd7e1e7fe064147c27 Mon Sep 17 00:00:00 2001 From: spezifisch Date: Fri, 26 Jul 2024 23:44:34 +0200 Subject: [PATCH] separate release build --- .github/workflows/ci.yml | 42 --------------------- .github/workflows/release.yml | 70 +++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5afc320..34ec1e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,9 +8,6 @@ on: branches: - main workflow_dispatch: - release: - types: - - created jobs: build: @@ -32,42 +29,3 @@ jobs: - name: Run tests run: cargo test --release - - release: - runs-on: ubuntu-latest - needs: build - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - override: true - - - name: Build - run: cargo build --release - - - 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 Asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: target/release/ifstat-rs - asset_name: ifstat-rs - asset_content_type: application/octet-stream diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7cee466 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,70 @@ +name: CI + +on: + push: + tags: + - v* + workflow_dispatch: + release: + types: + - created + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Build + run: cargo build --release + + - name: Run tests + run: cargo test --release + + release: + runs-on: ubuntu-latest + needs: build + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + + - name: Build + run: cargo build --release + + - 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 Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: target/release/ifstat-rs + asset_name: ifstat-rs + asset_content_type: application/octet-stream