Add GOCACHEPROG binary and pre-build stdlib cache for Go 1.25.5 #6
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: 'Package Pushed' | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| - v3 | |
| paths: | |
| - packages/** | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build-pkg: | |
| name: Build package | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: read | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 | |
| - name: Login to ghcr.io | |
| uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0 | |
| with: | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| registry: ghcr.io | |
| - name: Get list of changed files | |
| uses: lots0logs/gh-action-get-changed-files@af14147b3aba94b0ced11732399a2ab748097de9 # 2.1.4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Packages | |
| run: | | |
| PACKAGES=$(jq '.[]' -r ${HOME}/files*.json | awk -F/ '$1~/packages/ && $2 && $3{ print $2 "-" $3 }' | sort -u) | |
| echo "Packages: $PACKAGES" | |
| docker pull ghcr.io/codize-dev/piston/repo-builder:781f4aed6ebfab29d07ce4b0922dfd9247e66d5f@sha256:0c75faa302f1e34247fd19dc9b1b2a162257b1c56c52a871403afe00fe4b0e75 | |
| docker build -t repo-builder repo | |
| docker run -v "${{ github.workspace }}:/piston" repo-builder --no-server $PACKAGES | |
| ls -la packages | |
| - name: Upload Packages | |
| uses: svenstaro/upload-release-action@6b7fa9f267e90b50a19fef07b3596790bb941741 # 2.11.3 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: packages/*.pkg.tar.gz | |
| tag: pkgs | |
| overwrite: true | |
| file_glob: true | |
| create-index: | |
| name: Create Index | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| needs: build-pkg | |
| steps: | |
| - name: 'Download all release assets' | |
| run: curl -s https://api.github.com/repos/codize-dev/piston/releases/latest | jq '.assets[].browser_download_url' -r | xargs -L 1 curl -sLO | |
| - name: 'Generate index file' | |
| run: | | |
| echo "" > index | |
| BASEURL=https://github.com/codize-dev/piston/releases/download/pkgs/ | |
| for pkg in *.pkg.tar.gz | |
| do | |
| PKGFILE=$(basename $pkg) | |
| PKGFILENAME=$(echo $PKGFILE | sed 's/\.pkg\.tar\.gz//g') | |
| PKGNAME=$(echo $PKGFILENAME | grep -oP '^\K.+(?=-)') | |
| PKGVERSION=$(echo $PKGFILENAME | grep -oP '^.+-\K.+') | |
| PKGCHECKSUM=$(sha256sum $PKGFILE | awk '{print $1}') | |
| echo "$PKGNAME,$PKGVERSION,$PKGCHECKSUM,$BASEURL$PKGFILE" >> index | |
| echo "Adding package $PKGNAME-$PKGVERSION" | |
| done | |
| - name: Upload index | |
| uses: svenstaro/upload-release-action@6b7fa9f267e90b50a19fef07b3596790bb941741 # 2.11.3 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: index | |
| tag: pkgs | |
| overwrite: true | |
| file_glob: true |