Ensure release build deploys correctly (#2567)

This commit is contained in:
Tobie Morgan Hitchcock 2023-09-01 11:32:44 +01:00
parent 3c40af0165
commit ed48fddd2a

View file

@ -57,7 +57,7 @@ jobs:
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
command: make command: make
args: ci-workspace-coverage-complete args: ci-workspace-coverage
- name: Debug info - name: Debug info
if: always() if: always()
@ -237,13 +237,13 @@ jobs:
- name: Download amd64 binary - name: Download amd64 binary
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: surreal-nightly.linux-amd64 name: surreal-${{ github.ref_name }}.linux-amd64
path: amd64 path: amd64
- name: Download arm64 binary - name: Download arm64 binary
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: surreal-nightly.linux-arm64 name: surreal-${{ github.ref_name }}.linux-arm64
path: arm64 path: arm64
- name: Set file permissions - name: Set file permissions
@ -315,19 +315,19 @@ jobs:
include: include:
- arch: x86_64-apple-darwin - arch: x86_64-apple-darwin
os: macos-latest os: macos-latest
file: surreal-nightly.darwin-amd64 file: surreal-${{ github.ref_name }}.darwin-amd64
- arch: aarch64-apple-darwin - arch: aarch64-apple-darwin
os: macos-latest os: macos-latest
file: surreal-nightly.darwin-arm64 file: surreal-${{ github.ref_name }}.darwin-arm64
- arch: x86_64-unknown-linux-gnu - arch: x86_64-unknown-linux-gnu
os: ubuntu-latest os: ubuntu-latest
file: surreal-nightly.linux-amd64 file: surreal-${{ github.ref_name }}.linux-amd64
- arch: aarch64-unknown-linux-gnu - arch: aarch64-unknown-linux-gnu
os: ubuntu-latest os: ubuntu-latest
file: surreal-nightly.linux-arm64 file: surreal-${{ github.ref_name }}.linux-arm64
- arch: x86_64-pc-windows-msvc - arch: x86_64-pc-windows-msvc
os: windows-latest os: windows-latest
file: surreal-nightly.windows-amd64 file: surreal-${{ github.ref_name }}.windows-amd64
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- name: Download artifacts - name: Download artifacts
@ -346,15 +346,15 @@ jobs:
if: ${{ !contains(matrix.arch, 'windows') }} if: ${{ !contains(matrix.arch, 'windows') }}
shell: bash shell: bash
run: | run: |
aws s3 cp --cache-control 'no-store' ${{ matrix.file }}.tgz s3://download.surrealdb.com/nightly/ aws s3 cp --cache-control 'no-store' ${{ matrix.file }}.tgz s3://download.surrealdb.com/${{ github.ref_name }}/
aws s3 cp --cache-control 'no-store' ${{ matrix.file }}.txt s3://download.surrealdb.com/nightly/ aws s3 cp --cache-control 'no-store' ${{ matrix.file }}.txt s3://download.surrealdb.com/${{ github.ref_name }}/
- name: Publish windows binaries - name: Publish windows binaries
if: ${{ contains(matrix.arch, 'windows') }} if: ${{ contains(matrix.arch, 'windows') }}
shell: bash shell: bash
run: | run: |
aws s3 cp --cache-control 'no-store' ${{ matrix.file }}.exe s3://download.surrealdb.com/nightly/ aws s3 cp --cache-control 'no-store' ${{ matrix.file }}.exe s3://download.surrealdb.com/${{ github.ref_name }}/
aws s3 cp --cache-control 'no-store' ${{ matrix.file }}.txt s3://download.surrealdb.com/nightly/ aws s3 cp --cache-control 'no-store' ${{ matrix.file }}.txt s3://download.surrealdb.com/${{ github.ref_name }}/
package-macos: package-macos:
name: Package macOS universal binary name: Package macOS universal binary
@ -364,13 +364,13 @@ jobs:
- name: Download amd64 binary - name: Download amd64 binary
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: surreal-nightly.darwin-amd64 name: surreal-${{ github.ref_name }}.darwin-amd64
path: amd64 path: amd64
- name: Download arm64 binary - name: Download arm64 binary
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: surreal-nightly.darwin-arm64 name: surreal-${{ github.ref_name }}.darwin-arm64
path: arm64 path: arm64
- name: Configure AWS - name: Configure AWS
@ -383,13 +383,13 @@ jobs:
- name: Package universal MacOS binary - name: Package universal MacOS binary
shell: bash shell: bash
run: | run: |
FILE="surreal-nightly.darwin-universal" FILE="surreal-${{ github.ref_name }}.darwin-universal"
lipo -create -output surreal amd64/surreal arm64/surreal lipo -create -output surreal amd64/surreal arm64/surreal
chmod +x surreal chmod +x surreal
tar -zcvf $FILE.tgz surreal tar -zcvf $FILE.tgz surreal
echo $(shasum -a 256 $FILE.tgz | cut -f1 -d' ') > $FILE.txt echo $(shasum -a 256 $FILE.tgz | cut -f1 -d' ') > $FILE.txt
aws s3 cp --cache-control 'no-store' $FILE.tgz s3://download.surrealdb.com/nightly/ aws s3 cp --cache-control 'no-store' $FILE.tgz s3://download.surrealdb.com/${{ github.ref_name }}/
aws s3 cp --cache-control 'no-store' $FILE.txt s3://download.surrealdb.com/nightly/ aws s3 cp --cache-control 'no-store' $FILE.txt s3://download.surrealdb.com/${{ github.ref_name }}/
deploy: deploy:
name: Deploy name: Deploy