install: serve install.sh from website/ instead of github pages #3
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
| # Versioned release workflow. Fires on v* tag push. | |
| # | |
| # Produces (per tag): | |
| # packyard-<tag>-linux-<arch>.tar.gz (pinnable — e.g. v1.0.0-beta.1) | |
| # packyard-linux-<arch>.tar.gz (version-less alias; what | |
| # install.sh downloads via | |
| # /releases/latest/download/...) | |
| # SHA256SUMS (covers both) | |
| # | |
| # plus: | |
| # - GHCR Docker image tagged with {version}, {major.minor}, {major} | |
| # - GitHub Release with generated notes | |
| # | |
| # Prerelease-marker note: during the v1.0.0-beta.* period we DO NOT mark | |
| # these as prereleases, because GitHub's /releases/latest/download/… | |
| # redirect (which install.sh relies on) excludes prereleases. When we | |
| # ship stable v1.0.0 and start cutting v1.1.0-beta.* etc., re-enable | |
| # `prerelease: ${{ contains(github.ref_name, '-') }}` below. | |
| name: Release | |
| on: | |
| push: | |
| tags: ["v*"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| packages: write | |
| jobs: | |
| build: | |
| name: build linux/${{ matrix.arch }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: linux/amd64 | |
| arch: amd64 | |
| - platform: linux/arm64 | |
| arch: arm64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Build binary via Dockerfile | |
| run: | | |
| docker buildx build \ | |
| --platform ${{ matrix.platform }} \ | |
| --target export \ | |
| --build-arg VERSION=${{ github.ref_name }} \ | |
| --output type=local,dest=./out \ | |
| --cache-from type=gha \ | |
| --cache-to type=gha,mode=max \ | |
| . | |
| - name: Package tarballs | |
| run: | | |
| mkdir -p dist | |
| # Binary sits at out/packyard after the export target runs. | |
| install -m 0755 out/packyard dist/packyard | |
| # Version-pinned tarball (users pin with --version <tag>). | |
| tar -czf "dist/packyard-${GITHUB_REF_NAME}-linux-${{ matrix.arch }}.tar.gz" -C dist packyard | |
| # Version-less alias — install.sh downloads this via | |
| # GitHub's /releases/latest/download/ redirect, which | |
| # resolves the version transparently. | |
| tar -czf "dist/packyard-linux-${{ matrix.arch }}.tar.gz" -C dist packyard | |
| rm dist/packyard | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: bin-linux-${{ matrix.arch }} | |
| path: dist/*.tar.gz | |
| retention-days: 1 | |
| docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: docker/metadata-action@v5 | |
| id: meta | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| build-args: | | |
| VERSION=${{ github.ref_name }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| release: | |
| name: publish release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Compute checksums | |
| run: | | |
| cd dist | |
| sha256sum packyard-*.tar.gz | tee SHA256SUMS | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| # See file header for why we don't mark betas as prereleases. | |
| prerelease: false | |
| files: | | |
| dist/*.tar.gz | |
| dist/SHA256SUMS |