Bump version to 1.8.0 #33
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| create_release: | |
| name: Create Github Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Create Release | |
| id: create_release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| upload_url=$(gh release create ${{ github.ref_name }} --title "Release ${{ github.ref_name }}" --generate-notes) | |
| # The gh CLI doesn't return the upload_url directly in the same format, | |
| # but we can construct it or just use gh release upload later. | |
| # However, to keep the existing structure: | |
| echo "https://uploads.github.com/repos/${{ github.repository }}/releases/$(gh release view ${{ github.ref_name }} --json id -q .id)/assets{?name,label}" > release_url.txt | |
| - name: Save Release URL File for publish | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release_url | |
| path: release_url.txt | |
| build_artifact: | |
| needs: [create_release] | |
| name: Build Artifact | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - if: matrix.os == 'ubuntu-latest' | |
| uses: actions/cache@v4 | |
| name: Cache ~/.stack | |
| with: | |
| path: ~/.stack | |
| key: ${{ runner.os }}-stack-${{ hashFiles('**/stack.yaml.lock') }}-${{ hashFiles('**/package.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-stack-${{ hashFiles('**/stack.yaml.lock') }}- | |
| ${{ runner.os }}-stack- | |
| - uses: haskell-actions/setup@v2 | |
| with: | |
| ghc-version: "9.4.6" | |
| enable-stack: true | |
| stack-version: "latest" | |
| - if: matrix.os == 'ubuntu-latest' | |
| name: Build binary (linux/static) | |
| run: stack install --local-bin-path dist --flag git-brunch:static | |
| - if: matrix.os == 'macos-latest' | |
| name: Build binary (macos/dynamic) | |
| run: stack install --local-bin-path dist | |
| - name: Load Release URL File from release job | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release_url | |
| - name: Get Release File Name & Upload URL | |
| id: get_release_info | |
| run: | | |
| value=`cat release_url/release_url.txt` | |
| echo ::set-output name=upload_url::$value | |
| - name: Upload Release Asset | |
| id: upload-release-asset | |
| uses: actions/upload-release-asset@v1.0.1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.get_release_info.outputs.upload_url }} | |
| asset_path: ./dist/git-brunch | |
| asset_name: git-brunch-${{ runner.os }} | |
| asset_content_type: application/octet-stream |