feat: allow project to be specified on issue create #3
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: Go | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| release: | |
| types: [published] | |
| jobs: | |
| build-release: | |
| name: Build release Executable (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-musl | |
| - os: ubuntu-latest | |
| target: armv7-unknown-linux-musleabihf | |
| - os: ubuntu-latest | |
| target: aarch64-unknown-linux-musl | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| env: | |
| BINARY_EXTENSION: ${{ endsWith(matrix.target, '-msvc') && '.exe' || '' }} | |
| PATH_BINARY: ${{ github.workspace }}/target/${{ matrix.TARGET }}/release/lin${{ matrix.EXTENSION }}${{ endsWith(matrix.target, '-msvc') && '.exe' || '' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install deps for linux build | |
| if: ${{ matrix.os == 'ubuntu-latest' }} | |
| uses: awalsh128/cache-apt-pkgs-action@latest | |
| with: | |
| packages: gcc libgl1-mesa-dev xorg-dev | |
| version: 1.0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25.4' | |
| - name: Build | |
| run: | | |
| go build -v -o ${{ env.PATH_BINARY }} ./cmd/... | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.target }}-lin${{ env.BINARY_EXTENSION }} | |
| path: ${{ env.PATH_BINARY }} | |
| - name: Evaluate shasum | |
| run: echo -n $(shasum -ba 256 ${{ env.PATH_BINARY }} | cut -d " " -f 1) > ${{ env.PATH_BINARY }}.sha256 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.target }}-lin.sha256 | |
| path: ${{ env.PATH_BINARY }}.sha256 | |
| - name: '[Optional] Publish Artifact' | |
| if: ${{ github.event_name == 'release' }} | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: ${{ env.PATH_BINARY }} | |
| asset_name: ${{ matrix.target }}-lin${{ env.BINARY_EXTENSION }} | |
| tag: ${{ github.ref }} | |
| overwrite: true | |
| - name: '[Optional] Publish Artifact (shasum)' | |
| if: ${{ github.event_name == 'release' }} | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: ${{ env.PATH_BINARY }}.sha256 | |
| asset_name: ${{ matrix.target }}-lin${{ env.BINARY_EXTENSION }}.sha256 | |
| tag: ${{ github.ref }} | |
| overwrite: true |