|
| 1 | +name: Attach client binaries to release |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + release_tag: |
| 7 | + description: "Release tag (e.g. v1.9.0)" |
| 8 | + required: true |
| 9 | + default: "v1.9.0" |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - jdetter/attach-artifacts-workflow |
| 13 | + |
| 14 | +jobs: |
| 15 | + upload-assets: |
| 16 | + runs-on: spacetimedb-new-runner |
| 17 | + container: |
| 18 | + image: localhost:5000/spacetimedb-ci:latest |
| 19 | + options: >- |
| 20 | + --privileged |
| 21 | + permissions: |
| 22 | + contents: write # needed to modify releases |
| 23 | + |
| 24 | + steps: |
| 25 | + - name: Checkout |
| 26 | + uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - name: Download artifacts from private base URL |
| 29 | + env: |
| 30 | + RELEASE_TAG: ${{ github.event.inputs.release_tag }} |
| 31 | + BASE_URL: ${{ secrets.ARTIFACT_BASE_URL }} |
| 32 | + run: | |
| 33 | + set -euo pipefail |
| 34 | +
|
| 35 | + FULL_URL="$BASE_URL/$RELEASE_TAG" |
| 36 | +
|
| 37 | + mkdir -p artifacts |
| 38 | + cd artifacts |
| 39 | +
|
| 40 | + wget "$FULL_URL/spacetime-aarch64-apple-darwin.tar.gz" |
| 41 | + wget "$FULL_URL/spacetime-aarch64-unknown-linux-gnu.tar.gz" |
| 42 | + wget "$FULL_URL/spacetime-x86_64-apple-darwin.tar.gz" |
| 43 | + wget "$FULL_URL/spacetime-x86_64-pc-windows-msvc.zip" |
| 44 | + wget "$FULL_URL/spacetime-x86_64-unknown-linux-gnu.tar.gz" |
| 45 | + wget "$FULL_URL/spacetimedb-update-aarch64-apple-darwin" |
| 46 | + wget "$FULL_URL/spacetimedb-update-aarch64-unknown-linux-gnu" |
| 47 | + wget "$FULL_URL/spacetimedb-update-x86_64-apple-darwin" |
| 48 | + wget "$FULL_URL/spacetimedb-update-x86_64-pc-windows-msvc.exe" |
| 49 | + wget "$FULL_URL/spacetimedb-update-x86_64-unknown-linux-gnu" |
| 50 | +
|
| 51 | + - name: Upload artifacts to GitHub Release |
| 52 | + env: |
| 53 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + RELEASE_TAG: ${{ github.event.inputs.release_tag }} |
| 55 | + run: | |
| 56 | + set -euo pipefail |
| 57 | +
|
| 58 | + cd artifacts |
| 59 | +
|
| 60 | + gh release upload "$RELEASE_TAG" ./* \ |
| 61 | + --repo "$GITHUB_REPOSITORY" \ |
| 62 | + --clobber |
| 63 | +
|
0 commit comments