Release version 1.7.3 #11
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 Focus | |
| env: | |
| dev_tag: nightly | |
| go_version: 1.24 | |
| REPO_OWNER: ronilaukkarinen | |
| REPO_WEBSITE: https://github.com/ronilaukkarinen/focus | |
| REPO_DESCRIPTION: Focus is a flexible command-line productivity timer with flow mode for uninterrupted work sessions | |
| REPO_MAINTAINER: Roni Laukkarinen | |
| REPO_AUTHOR_NAME: Roni Laukkarinen | |
| REPO_AUTHOR_EMAIL: roni@dude.fi | |
| REPO_BINARY_NAME: focus | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| create_tag_master: | |
| name: Create nightly tag for master branch | |
| runs-on: ubuntu-latest | |
| if: github.ref_type == 'branch' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Update nightly tag | |
| run: | | |
| git tag -d ${{ env.dev_tag }} || true | |
| git push origin :refs/tags/${{ env.dev_tag }} || true | |
| git tag ${{ env.dev_tag }} | |
| git push origin ${{ env.dev_tag }} | |
| publish_nightly: | |
| needs: create_tag_master | |
| name: Release nightly version | |
| runs-on: ubuntu-latest | |
| env: | |
| GH_REPO: ${{ github.repository }} | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go ${{ env.go_version }} | |
| uses: actions/setup-go@v3 | |
| with: | |
| go-version: ${{ env.go_version }} | |
| - name: Install libasound2-dev | |
| run: sudo apt install libasound2-dev | |
| - name: Delete existing nightly release | |
| run: | | |
| gh release delete nightly --yes || true | |
| - name: Create nightly release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: refs/tags/${{ env.dev_tag }} | |
| name: Development build (master) | |
| body: | | |
| This build is directly sourced from the `master` branch in active development. As such, it may include experimental features and potential bugs. | |
| draft: false | |
| prerelease: true | |
| - name: Build assets with Goreleaser | |
| uses: goreleaser/goreleaser-action@v4 | |
| with: | |
| version: latest | |
| args: release --clean --snapshot | |
| - name: Upload assets to nightly release | |
| run: gh release upload ${{ env.dev_tag }} dist/{*.tar.gz,*.zip,*.tar.zst,*.deb,*.rpm,*.apk,checksums.txt} --clobber | |
| run_tests: | |
| runs-on: ${{ matrix.os }} | |
| if: github.ref_type == 'tag' | |
| strategy: | |
| matrix: | |
| os: [macos-latest, ubuntu-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v3 | |
| with: | |
| go-version: ${{ env.go_version }} | |
| - name: Install libasound2-dev | |
| run: sudo apt install libasound2-dev | |
| if: matrix.os == 'ubuntu-latest' | |
| - name: Run tests | |
| run: go test ./... -race | |
| publish_stable: | |
| name: Release stable version | |
| runs-on: ubuntu-latest | |
| needs: run_tests | |
| if: github.ref_type == 'tag' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Go ${{ env.go_version }} | |
| uses: actions/setup-go@v3 | |
| with: | |
| go-version: ${{ env.go_version }} | |
| - name: Install libasound2-dev | |
| run: sudo apt install libasound2-dev | |
| - name: Create stable release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: ${{ github.ref_name }} | |
| body: ${{ env.CHANGELOG }} | |
| draft: false | |
| prerelease: false | |
| - name: Run Goreleaser | |
| uses: goreleaser/goreleaser-action@v4 | |
| with: | |
| version: latest | |
| args: release --clean | |
| env: | |
| GORELEASER_GITHUB_TOKEN: ${{ secrets.SCOOP_BUCKET_GITHUB_TOKEN }} | |
| FURY_PUSH_TOKEN: ${{ secrets.FURY_PUSH_TOKEN }} | |
| FURY_USERNAME: ${{ secrets.FURY_USERNAME }} | |
| trigger_darwin_nightly: | |
| name: Trigger nightly macOS build | |
| runs-on: ubuntu-latest | |
| needs: publish_nightly | |
| steps: | |
| - name: Trigger Darwin build | |
| uses: peter-evans/repository-dispatch@v2 | |
| with: | |
| event-type: release-focus | |
| client-payload: '{"ref": "${{ github.ref_name }}", "ref_type": "${{ github.ref_type }}" }' | |
| trigger_darwin_stable: | |
| name: Trigger stable macOS build | |
| runs-on: ubuntu-latest | |
| needs: publish_stable | |
| steps: | |
| - name: Trigger Darwin build | |
| uses: peter-evans/repository-dispatch@v2 | |
| with: | |
| event-type: release-focus | |
| client-payload: '{"ref": "${{ github.ref_name }}", "ref_type": "${{ github.ref_type }}" }' |