Skip to content

Commit

Permalink
Improve step and job separation
Browse files Browse the repository at this point in the history
  • Loading branch information
Goju-Ryu authored and sharkdp committed Feb 2, 2025
1 parent a4faff7 commit 245f1cc
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,24 @@ jobs:
- name: Run tests
run: cargo test --locked ${{ env.MSRV_FEATURES }}

release_check:
name: Release check
runs-on: ubuntu-latest
outputs:
IS_RELEASE: ${{ steps.is-release.outputs.IS_RELEASE }}
steps:
- name: Check for release
id: is-release
shell: bash
run: |
unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT
vscode_extension_package:
name: Package vscode extension
runs-on: ubuntu-latest
outputs:
VSCE_PATH: ${{ steps.vsce-package.outputs.VSCE_PATH }}
needs:
- release_check
defaults:
run:
working-directory: ./vscode-extension
Expand Down Expand Up @@ -146,13 +159,22 @@ jobs:
with:
name: ${{ steps.vsce-package.outputs.VSCE_NAME }}
path: ${{ steps.vsce-package.outputs.VSCE_PATH }}

- name: Publish archives and packages
uses: softprops/action-gh-release@v1
if: needs.release_check.outputs.IS_RELEASE
with:
files: |
${{ steps.vsce-package.outputs.VSCE_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build:
name: ${{ matrix.job.target }} (${{ matrix.job.os }})
runs-on: ${{ matrix.job.os }}
needs:
- crate_metadata
- vscode_extension_package
- release_check
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -403,20 +425,12 @@ jobs:
name: ${{ steps.debian-package.outputs.DPKG_NAME }}
path: ${{ steps.debian-package.outputs.DPKG_PATH }}

- name: Check for release
id: is-release
shell: bash
run: |
unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
echo "IS_RELEASE=${IS_RELEASE}" >> $GITHUB_OUTPUT
- name: Publish archives and packages
uses: softprops/action-gh-release@v1
if: steps.is-release.outputs.IS_RELEASE
if: needs.release_check.outputs.IS_RELEASE
with:
files: |
${{ steps.package.outputs.PKG_PATH }}
${{ steps.debian-package.outputs.DPKG_PATH }}
${{ needs.vscode_extension_package.outputs.VSCE_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 245f1cc

Please sign in to comment.