|
| 1 | +name: Release opensuse 15.6 amd64 and arm64 |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*.*.*' |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + actions: write |
| 11 | + attestations: write |
| 12 | + packages: read |
| 13 | + |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + include: |
| 20 | + - arch: amd64 |
| 21 | + runner: ubuntu-latest |
| 22 | + container_opts: "--platform linux/amd64" |
| 23 | + - arch: arm64 |
| 24 | + runner: ubuntu-24.04-arm |
| 25 | + container_opts: "--platform linux/arm64" |
| 26 | + runs-on: ${{ matrix.runner }} |
| 27 | + container: |
| 28 | + image: ghcr.io/sarus-suite/parallax/ci-runner-opensuse156:latest |
| 29 | + options: ${{ matrix.container_opts }} |
| 30 | + credentials: |
| 31 | + username: ${{ github.actor }} |
| 32 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 33 | + env: |
| 34 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 35 | + GITHUB_REPOSITORY: ${{ github.repository }} |
| 36 | + GITHUB_REF: ${{ github.ref }} |
| 37 | + GITHUB_EVENT_PATH: ${{ github.event_path }} |
| 38 | + |
| 39 | + steps: |
| 40 | + - name: Checkout code |
| 41 | + uses: actions/checkout@v4 |
| 42 | + |
| 43 | + - name: Dump GO env |
| 44 | + run: | |
| 45 | + echo "--- all GO* vars ---" |
| 46 | + env | grep '^GO' || true |
| 47 | + echo "--- go env ---" |
| 48 | + go env |
| 49 | +
|
| 50 | + - name: Install go deps |
| 51 | + run: go get . |
| 52 | + |
| 53 | + - name: Build Linux binary ${{ matrix.arch }} |
| 54 | + env: |
| 55 | + CGO_ENABLED: "1" |
| 56 | + CC: gcc |
| 57 | + GOARCH: ${{ matrix.arch }} |
| 58 | + GOOS: linux |
| 59 | + GOFLAGS: "-buildvcs=false" |
| 60 | + GO_LDFLAGS: "-linkmode external" |
| 61 | + CGO_LDFLAGS: "-g -O2" |
| 62 | + run: | |
| 63 | + mkdir -p dist |
| 64 | + go build -v -x \ |
| 65 | + -ldflags "-X 'github.com/sarus-suite/parallax/version.Version=${{ github.ref_name }}'" \ |
| 66 | + -o dist/parallax-${{ github.ref_name }}-opensuse-15.6-${{ matrix.arch }} \ |
| 67 | + . |
| 68 | +
|
| 69 | + - name: Inspect binary |
| 70 | + run: | |
| 71 | + stat dist/parallax-${{ github.ref_name }}-opensuse-15.6-${{ matrix.arch }} |
| 72 | + readelf -l dist/parallax-${{ github.ref_name }}-opensuse-15.6-${{ matrix.arch }} | grep interpreter || true |
| 73 | + ldd dist/parallax-${{ github.ref_name }}-opensuse-15.6-${{ matrix.arch }} || echo "static :/" |
| 74 | +
|
| 75 | + - name: Create or Update GitHub Release and Upload Asset |
| 76 | + uses: ncipollo/release-action@v1 |
| 77 | + with: |
| 78 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 79 | + tag: ${{ github.ref_name }} |
| 80 | + name: Release ${{ github.ref_name }} |
| 81 | + artifacts: dist/parallax-${{ github.ref_name }}-opensuse-15.6-${{ matrix.arch }} |
| 82 | + allowUpdates: true |
| 83 | + replacesArtifacts: false |
| 84 | + draft: false |
| 85 | + prerelease: false |
| 86 | + |
0 commit comments