bump up version to 0.4.1 #53
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - v* | |
| pull_request: | |
| permissions: | |
| contents: read | |
| defaults: | |
| run: | |
| shell: bash --noprofile --norc -euxo pipefail {0} | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ${{ matrix.runs-on }} | |
| strategy: | |
| matrix: | |
| os: [linux, darwin, windows] | |
| include: | |
| - os: linux | |
| arch: amd64 | |
| runs-on: ubuntu-latest | |
| - os: darwin | |
| arch: arm64 | |
| runs-on: macos-latest | |
| - os: windows | |
| arch: amd64 | |
| runs-on: windows-latest | |
| fail-fast: false | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Haskell | |
| uses: haskell-actions/setup@v2 | |
| with: | |
| enable-stack: true | |
| - name: Build | |
| run: stack build | |
| - name: Test | |
| run: stack test | |
| - name: Dist | |
| id: dist | |
| if: matrix.os == 'linux' | |
| run: | | |
| stack sdist --test-tarball | |
| echo path=$(ls "$(stack path --dist-dir)"/*.tar.gz) >> "$GITHUB_OUTPUT" | |
| - name: Set executable name | |
| id: executable | |
| run: echo name=${{ github.event.repository.name }} >> "$GITHUB_OUTPUT" | |
| - name: Set artifact name | |
| id: artifact | |
| run: echo name=${{ steps.executable.outputs.name }}_${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || | |
| github.event.pull_request.head.sha || github.sha }}_${{ matrix.os }}_${{ matrix.arch }} >> "$GITHUB_OUTPUT" | |
| - name: Build artifact | |
| run: | | |
| mkdir ${{ steps.artifact.outputs.name }} | |
| cp README.md LICENSE _qhs "$(stack path --local-install-root)/bin/${{ steps.executable.outputs.name }}" ${{ steps.artifact.outputs.name }} | |
| if [[ ${{ matrix.os }} == windows ]]; then | |
| powershell Compress-Archive -Path ${{ steps.artifact.outputs.name }} -DestinationPath ${{ steps.artifact.outputs.name }}.zip | |
| else | |
| zip -r ${{ steps.artifact.outputs.name }}.zip ${{ steps.artifact.outputs.name }} | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ steps.artifact.outputs.name }} | |
| path: ${{ steps.artifact.outputs.name }}.zip | |
| - name: Upload dist | |
| if: matrix.os == 'linux' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: dist | |
| path: ${{ steps.dist.outputs.path }} | |
| release: | |
| name: Release | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v7 | |
| - name: Create release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| name: Release ${{ github.ref_name }} | |
| artifacts: '*/*.zip' |