diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 829a100..f02d7c0 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -14,17 +14,8 @@ permissions: contents: write # Grant write permissions to the contents jobs: - build: + build_linux: runs-on: ubuntu-latest - outputs: - windows-artifact: ${{ steps.windows-artifact.outputs.artifact }} - linux-artifact: ${{ steps.linux-artifact.outputs.artifact }} - macos-artifact: ${{ steps.macos-artifact.outputs.artifact }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - goos: [linux, windows, darwin] - goarch: [amd64, amd64, arm64] steps: - uses: actions/checkout@v4 @@ -33,42 +24,85 @@ jobs: with: go-version: '1.22' - - name: Build for ${{ matrix.os }} - run: go build -o tradingview-to-ibkr-${{ matrix.goos }}-${{ matrix.goarch }} -tags netgo + - name: Build for Linux + run: go build -o tradingview-to-ibkr-linux64 env: - GOOS: ${{ matrix.goos }} - GOARCH: ${{ matrix.goarch }} + GOOS: linux + GOARCH: amd64 - - name: Archive build artifacts - id: archive + - name: Archive Linux build artifact uses: actions/upload-artifact@v3 with: - name: tradingview-to-ibkr-${{ matrix.goos }}-${{ matrix.goarch }} - path: tradingview-to-ibkr-${{ matrix.goos }}-${{ matrix.goarch }} + name: tradingview-to-ibkr-linux64 + path: tradingview-to-ibkr-linux64 + + build_windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.22' + + - name: Build for Windows + run: go build -o tradingview-to-ibkr-win64.exe + env: + GOOS: windows + GOARCH: amd64 + + - name: Archive Windows build artifact + uses: actions/upload-artifact@v3 + with: + name: tradingview-to-ibkr-win64 + path: tradingview-to-ibkr-win64.exe + + build_macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.22' + + - name: Build for macOS + run: go build -o tradingview-to-ibkr-macos-arm64 + env: + GOOS: darwin + GOARCH: arm64 + + - name: Archive macOS build artifact + uses: actions/upload-artifact@v3 + with: + name: tradingview-to-ibkr-macos-arm64 + path: tradingview-to-ibkr-macos-arm64 create_release: runs-on: ubuntu-latest - needs: build + needs: [build_linux, build_windows, build_macos] if: startsWith(github.ref, 'refs/tags/') steps: - uses: actions/checkout@v4 - - name: Download build artifacts + - name: Download Linux build artifact uses: actions/download-artifact@v3 with: - name: tradingview-to-ibkr-linux-amd64 + name: tradingview-to-ibkr-linux64 path: ./build/linux64 - - name: Download Windows artifact + - name: Download Windows build artifact uses: actions/download-artifact@v3 with: - name: tradingview-to-ibkr-windows-amd64 + name: tradingview-to-ibkr-win64 path: ./build/win64 - - name: Download macOS artifact + - name: Download macOS build artifact uses: actions/download-artifact@v3 with: - name: tradingview-to-ibkr-darwin-arm64 + name: tradingview-to-ibkr-macos-arm64 path: ./build/mac64 - name: Extract tag name @@ -95,7 +129,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./build/linux64/tradingview-to-ibkr-linux-amd64 + asset_path: ./build/linux64/tradingview-to-ibkr-linux64 asset_name: tradingview-to-ibkr-linux64 asset_content_type: application/octet-stream @@ -105,7 +139,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./build/win64/tradingview-to-ibkr-windows-amd64 + asset_path: ./build/win64/tradingview-to-ibkr-win64.exe asset_name: tradingview-to-ibkr-win64 asset_content_type: application/octet-stream @@ -115,6 +149,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./build/mac64/tradingview-to-ibkr-darwin-arm64 + asset_path: ./build/mac64/tradingview-to-ibkr-macos-arm64 asset_name: tradingview-to-ibkr-macos-arm64 asset_content_type: application/octet-stream