feat: upgrades to updated fwatcher pkg #63
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: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'v*' | |
| branches: | |
| - master | |
| paths: | |
| - "cmd/run/**" | |
| - ".github/**" | |
| - "pkg/**" | |
| - go.* # go.mod, and go.sum | |
| - flake.* | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| build-binary: | |
| # strategy: | |
| # fail-fast: true | |
| # matrix: | |
| # runner: ubuntu-latest | |
| # arch: | |
| # - amd64 | |
| # - arm64 | |
| # os: | |
| # - linux | |
| # - darwin | |
| # - windows | |
| name: Building runfile | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: nxtcoder17/actions/setup-cache-go@v1 | |
| with: | |
| cache_key: "run" | |
| working_directory: . | |
| - uses: nxtcoder17/actions/setup-nix-cachix@v1 | |
| with: | |
| flake_lock: "./flake.lock" | |
| nix_develop_arguments: ".#default" | |
| cachix_cache_name: ${{ secrets.CACHIX_CACHE_NAME }} | |
| cachix_auth_token: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| - uses: nxtcoder17/actions/metadata@main | |
| id: meta | |
| - name: Build Binary | |
| shell: bash | |
| env: | |
| CGO_ENABLED: 0 | |
| run: |+ | |
| arch_list=("amd64" "arm64") | |
| os_list=("linux" "darwin") | |
| for os in "${os_list[@]}"; do | |
| for arch in "${arch_list[@]}"; do | |
| echo "🚧 building binary for os=$os arch=$arch" | |
| export GOARCH=$arch | |
| export GOOS=$os | |
| binary=bin/run-$GOOS-$GOARCH | |
| time go build -o $binary -ldflags="-s -w -X main.Version=${{ steps.meta.outputs.version }}-${{steps.meta.outputs.short_sha}}" -tags urfave_cli_no_docs ./cmd/run | |
| done | |
| done | |
| - name: running for master branch | |
| if: startsWith(github.ref, 'refs/heads/') | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| version: ${{steps.meta.outputs.version}} | |
| run: |+ | |
| echo "running for a branch, will delete it's nightly release" | |
| gh release delete ${{steps.meta.outputs.version}} -y --cleanup-tag -R ${{ github.repository }} || echo "cleaned up nightly tag" | |
| - name: ensure github release exists | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| version: ${{steps.meta.outputs.version}} | |
| run: |+ | |
| echo "🔖 creating release for tag $version" | |
| gh release create $version -R ${{ github.repository }} --generate-notes --prerelease --draft=false || echo "release ($version) already exists, will use that one" | |
| - name: upload to github release | |
| shell: bash | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| version: ${{steps.meta.outputs.version}} | |
| run: |+ | |
| gh release upload $version -R ${{github.repository}} bin/* | |
| echo "🚀 updated binaries to github release" | |
| - name: mark release as latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| version: ${{steps.meta.outputs.version}} | |
| shell: bash | |
| run: |+ | |
| gh release edit $version -R ${{ github.repository }} --latest | |