goreleaser #50
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: goreleaser | |
| on: | |
| push: | |
| tags: | |
| - "*" | |
| workflow_dispatch: # Allow triggering manually. | |
| jobs: | |
| # build-sysroots builds the sysroots for linux/amd64, linux/arm64, and | |
| # windows/amd64. The macOS sysroots are handled in macos-prep.yaml. | |
| # It is pinned to Ubuntu 24.04 for now, because we want to be intentional | |
| # about moving to a newer OS release version. OS version changes may impact | |
| # the commands below, and the resulting sysroots. | |
| build-sysroots: | |
| runs-on: ubuntu-24.04 | |
| env: | |
| SYSROOT_DIR: ${{ github.workspace }}/sysroots | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| # TODO(cfunkhouser): Restore from cache and skip the following. | |
| # This step assumes the Ubuntu execution environment will be x86_64. If | |
| # this step fails with APT installation errors including 404s, it's likely | |
| # that this action is scheduled in an ARM-native environment, and will | |
| # need updating. | |
| - name: Install cross-build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| g++-aarch64-linux-gnu \ | |
| g++-x86-64-linux-gnu \ | |
| gcc-aarch64-linux-gnu \ | |
| gcc-x86-64-linux-gnu \ | |
| libc6-dev-amd64-cross \ | |
| libc6-dev-arm64-cross \ | |
| mingw-w64 \ | |
| rsync \ | |
| tar | |
| - name: Generate linux/amd64 sysroot | |
| run: | | |
| export TRIPLET=x86_64-linux-gnu | |
| mkdir -p $SYSROOT_DIR/$TRIPLET | |
| rsync -a /usr/$TRIPLET/ $SYSROOT_DIR/$TRIPLET/ | |
| rsync -a /usr/include/ $SYSROOT_DIR/$TRIPLET/include/ | |
| tar -czf $SYSROOT_DIR/${TRIPLET}.tar.gz -C $SYSROOT_DIR $TRIPLET | |
| - name: Generate linux/arm64 sysroot | |
| run: | | |
| export TRIPLET=aarch64-linux-gnu | |
| mkdir -p $SYSROOT_DIR/$TRIPLET | |
| rsync -a /usr/$TRIPLET/ $SYSROOT_DIR/$TRIPLET/ | |
| rsync -a /usr/include/ $SYSROOT_DIR/$TRIPLET/include/ | |
| tar -czf $SYSROOT_DIR/${TRIPLET}.tar.gz -C $SYSROOT_DIR $TRIPLET | |
| - name: Generate windows/amd64 MinGW-w64 sysroot | |
| run: | | |
| TRIPLET=x86_64-w64-mingw32 | |
| mkdir -p $SYSROOT_DIR/$TRIPLET | |
| rsync -a /usr/$TRIPLET/ $SYSROOT_DIR/$TRIPLET/ | |
| tar -czf $SYSROOT_DIR/${TRIPLET}.tar.gz -C $SYSROOT_DIR $TRIPLET | |
| - name: Upload sysroots | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: restish-cgo-sysroots | |
| path: $SYSROOT_DIR/*.tar.gz | |
| retention-days: 14 | |
| # goreleaser: | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - name: Checkout repository | |
| # uses: actions/checkout@v5 | |
| # - name: Set up Go | |
| # uses: actions/setup-go@v2 | |
| # with: | |
| # go-version: 1.24 | |
| # - name: Run GoReleaser | |
| # uses: goreleaser/goreleaser-action@v2 | |
| # with: | |
| # version: latest | |
| # args: release --clean | |
| # env: | |
| # GITHUB_TOKEN: ${{ secrets.GH_PAT }} |