release workflow binary build debug #43
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 | |
| actions: write | |
| attestations: write | |
| packages: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/sarus-suite/parallax/ci-runner:latest | |
| credentials: | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| GITHUB_REF: ${{ github.ref }} | |
| GITHUB_EVENT_PATH: ${{ github.event_path }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Dump GO env | |
| run: | | |
| echo "--- all GO* vars ---" | |
| env | grep '^GO' | |
| echo "--- go env ---" | |
| go env | |
| - name: Install go deps | |
| run: go get . | |
| - name: Build Linux binaries | |
| env: | |
| CGO_ENABLED: "1" | |
| CC: gcc | |
| GOOS: linux | |
| GOFLAGS: "-buildvcs=false" | |
| GO_LDFLAGS: "-linkmode external" | |
| CGO_LDFLAGS: "-g -O2" | |
| run: | | |
| mkdir -p dist | |
| for arch in amd64; do | |
| GOARCH=$arch go build -v -x \ | |
| -ldflags "-X 'github.com/sarus-suite/parallax/version.Version=${{ github.ref_name }}'" \ | |
| -o dist/parallax-${{ github.ref_name }}-linux-$arch \ | |
| . | |
| done | |
| - name: Inspect binary | |
| run: | | |
| file dist/parallax-${{ github.ref_name }}-linux-amd64 | |
| readelf -l dist/parallax-${{ github.ref_name }}-linux-amd64 | grep interpreter || true | |
| ldd dist/parallax-${{ github.ref_name }}-linux-amd64 || echo "static :/" | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }}-a | |
| release_name: Release ${{ github.ref_name }}-a | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload amd64 binary | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| asset_path: dist/parallax-${{ github.ref_name }}-linux-amd64 | |
| asset_name: parallax-${{ github.ref_name }}-linux-amd64 | |
| asset_content_type: application/octet-stream | |
| # - name: Upload arm64 binary | |
| # uses: actions/upload-release-asset@v1 | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # with: | |
| # upload_url: ${{ steps.create_release.outputs.upload_url }} | |
| # asset_path: dist/parallax-${{ github.ref_name }}-linux-arm64 | |
| # asset_name: parallax-${{ github.ref_name }}-linux-arm64 | |
| # asset_content_type: application/octet-stream | |