2022-09-22 14:07:37 +00:00
|
|
|
name: Version release
|
2022-09-22 13:56:27 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*.*.*"
|
|
|
|
|
2023-03-30 20:14:06 +00:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
2022-09-22 13:56:27 +00:00
|
|
|
jobs:
|
|
|
|
|
|
|
|
test:
|
|
|
|
name: Test
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest-16-cores
|
2022-09-22 13:56:27 +00:00
|
|
|
steps:
|
|
|
|
|
2023-08-03 09:55:06 +00:00
|
|
|
- name: Install stable toolchain
|
2023-08-24 16:33:57 +00:00
|
|
|
uses: dtolnay/rust-toolchain@master
|
|
|
|
with:
|
|
|
|
toolchain: 1.71.1
|
2023-08-03 09:55:06 +00:00
|
|
|
|
2022-09-22 13:56:27 +00:00
|
|
|
- name: Checkout sources
|
2022-12-26 14:14:05 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-09-22 13:56:27 +00:00
|
|
|
|
2023-08-03 09:55:06 +00:00
|
|
|
- name: Setup cache
|
|
|
|
uses: Swatinem/rust-cache@v2
|
2023-08-14 15:36:27 +00:00
|
|
|
with:
|
|
|
|
save-if: ${{ github.ref == 'refs/heads/main' }}
|
2023-08-03 09:55:06 +00:00
|
|
|
|
2023-03-31 19:12:10 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get -y update
|
|
|
|
|
2023-08-03 09:55:06 +00:00
|
|
|
- name: Free up some disk space
|
|
|
|
run: |
|
|
|
|
(set -x; df -h)
|
|
|
|
# Free up some disk space by removing unused files
|
|
|
|
(set -x; sudo rm -rf /imagegeneration || true)
|
|
|
|
(set -x; sudo rm -rf /opt/az || true)
|
|
|
|
(set -x; sudo rm -rf /opt/hostedtoolcache || true)
|
|
|
|
(set -x; sudo rm -rf /opt/google || true)
|
|
|
|
(set -x; sudo rm -rf /opt/pipx || true)
|
|
|
|
(set -x; df -h)
|
2022-09-22 13:56:27 +00:00
|
|
|
|
2023-06-23 19:21:02 +00:00
|
|
|
- name: Install cargo-llvm-cov
|
|
|
|
uses: taiki-e/install-action@cargo-llvm-cov
|
|
|
|
|
2023-08-03 09:55:06 +00:00
|
|
|
- name: Install cargo-make
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: install
|
|
|
|
args: --debug cargo-make
|
|
|
|
|
|
|
|
- name: Test workspace + coverage
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: make
|
2023-09-01 10:32:44 +00:00
|
|
|
args: ci-workspace-coverage
|
2023-06-23 19:21:02 +00:00
|
|
|
|
2023-08-18 07:16:13 +00:00
|
|
|
- name: Debug info
|
|
|
|
if: always()
|
|
|
|
run: |
|
|
|
|
set -x
|
|
|
|
free -m
|
|
|
|
df -h
|
|
|
|
ps auxf
|
|
|
|
cat /tmp/surrealdb.log || true
|
|
|
|
|
2023-06-23 19:21:02 +00:00
|
|
|
- name: Upload coverage report
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: code-coverage-report
|
|
|
|
path: target/llvm-cov/html/
|
|
|
|
retention-days: 30
|
2022-09-22 13:56:27 +00:00
|
|
|
|
|
|
|
lint:
|
|
|
|
name: Lint
|
2023-07-25 11:37:43 +00:00
|
|
|
runs-on: ubuntu-latest-16-cores
|
2022-09-22 13:56:27 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checkout sources
|
2022-12-26 14:14:05 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-09-22 13:56:27 +00:00
|
|
|
|
2023-03-31 19:12:10 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get -y update
|
|
|
|
|
2022-09-22 13:56:27 +00:00
|
|
|
- name: Install stable toolchain
|
2023-08-24 16:33:57 +00:00
|
|
|
uses: dtolnay/rust-toolchain@master
|
2022-09-22 13:56:27 +00:00
|
|
|
with:
|
2023-08-24 16:33:57 +00:00
|
|
|
toolchain: 1.71.1
|
2023-03-31 23:26:18 +00:00
|
|
|
targets: wasm32-unknown-unknown
|
2022-09-22 13:56:27 +00:00
|
|
|
components: rustfmt, clippy
|
|
|
|
|
2023-08-03 09:55:06 +00:00
|
|
|
- name: Install cargo-make
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: install
|
|
|
|
args: --debug cargo-make
|
2022-09-22 13:56:27 +00:00
|
|
|
|
2023-08-03 09:55:06 +00:00
|
|
|
- name: Check workspace
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: make
|
|
|
|
args: ci-check
|
2022-09-22 13:56:27 +00:00
|
|
|
|
2023-08-03 09:55:06 +00:00
|
|
|
- name: Check format
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: make
|
|
|
|
args: ci-format
|
2023-06-19 22:35:19 +00:00
|
|
|
|
2023-08-03 09:55:06 +00:00
|
|
|
- name: Check wasm
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: make
|
|
|
|
args: ci-check-wasm
|
2022-09-22 13:56:27 +00:00
|
|
|
|
2023-08-03 09:55:06 +00:00
|
|
|
- name: Check clippy
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: make
|
|
|
|
args: ci-clippy
|
2023-03-31 23:26:18 +00:00
|
|
|
|
2022-09-22 13:56:27 +00:00
|
|
|
build:
|
|
|
|
name: Build ${{ matrix.arch }}
|
|
|
|
needs: [test, lint]
|
|
|
|
strategy:
|
2023-03-30 20:14:06 +00:00
|
|
|
fail-fast: false
|
2022-09-22 13:56:27 +00:00
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- arch: x86_64-apple-darwin
|
2023-05-30 18:44:47 +00:00
|
|
|
os: macos-latest-xl
|
2022-09-22 13:56:27 +00:00
|
|
|
file: surreal-${{ github.ref_name }}.darwin-amd64
|
|
|
|
opts: --features storage-tikv
|
|
|
|
- arch: aarch64-apple-darwin
|
2023-05-30 18:44:47 +00:00
|
|
|
os: macos-latest-xl
|
2022-09-22 13:56:27 +00:00
|
|
|
file: surreal-${{ github.ref_name }}.darwin-arm64
|
|
|
|
opts: --features storage-tikv
|
|
|
|
- arch: x86_64-unknown-linux-gnu
|
2023-07-25 11:37:43 +00:00
|
|
|
os: ubuntu-latest-16-cores
|
2022-09-22 13:56:27 +00:00
|
|
|
file: surreal-${{ github.ref_name }}.linux-amd64
|
|
|
|
opts: --features storage-tikv
|
|
|
|
- arch: aarch64-unknown-linux-gnu
|
2023-07-25 11:37:43 +00:00
|
|
|
os: ubuntu-latest-16-cores
|
2022-09-22 13:56:27 +00:00
|
|
|
file: surreal-${{ github.ref_name }}.linux-arm64
|
|
|
|
opts: --features storage-tikv
|
|
|
|
- arch: x86_64-pc-windows-msvc
|
2023-05-30 18:44:47 +00:00
|
|
|
os: windows-latest
|
2022-09-22 13:56:27 +00:00
|
|
|
file: surreal-${{ github.ref_name }}.windows-amd64
|
|
|
|
opts:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checkout sources
|
2022-12-26 14:14:05 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-09-22 13:56:27 +00:00
|
|
|
|
|
|
|
- name: Prepare environment
|
|
|
|
if: contains(matrix.arch, 'windows') && endsWith(matrix.arch, '-gnu')
|
|
|
|
run: echo "C:\msys64\usr\bin;$Env:Path" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
if: contains(matrix.arch, 'windows') && endsWith(matrix.arch, '-msvc')
|
|
|
|
run: |
|
|
|
|
vcpkg integrate install
|
|
|
|
|
2023-01-29 12:35:47 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
if: contains(matrix.arch, 'apple') && endsWith(matrix.arch, '-darwin')
|
|
|
|
run: |
|
|
|
|
brew install protobuf
|
|
|
|
|
2022-09-22 13:56:27 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
if: contains(matrix.arch, 'linux') && endsWith(matrix.arch, '-gnu')
|
|
|
|
run: |
|
|
|
|
sudo apt-get -y update
|
|
|
|
sudo apt-get -y install musl-tools qemu-user libc6-dev-arm64-cross
|
2023-03-31 18:58:27 +00:00
|
|
|
sudo apt-get -y install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
|
2022-09-22 13:56:27 +00:00
|
|
|
|
|
|
|
- name: Install FoundationDB
|
|
|
|
if: contains(matrix.arch, 'linux') && startsWith(matrix.arch, 'x86_64')
|
|
|
|
run: |
|
|
|
|
curl -sLO https://github.com/apple/foundationdb/releases/download/6.3.23/foundationdb-clients_6.3.23-1_amd64.deb
|
|
|
|
sudo dpkg -i --force-architecture foundationdb-clients_6.3.23-1_amd64.deb
|
|
|
|
rm -rf foundationdb-clients_6.3.23-1_amd64.deb
|
|
|
|
|
|
|
|
- name: Install stable toolchain
|
2023-08-24 16:33:57 +00:00
|
|
|
uses: dtolnay/rust-toolchain@master
|
2022-09-22 13:56:27 +00:00
|
|
|
with:
|
2023-08-24 16:33:57 +00:00
|
|
|
toolchain: 1.71.1
|
2022-12-26 14:14:05 +00:00
|
|
|
targets: ${{ matrix.arch }}
|
2022-09-22 13:56:27 +00:00
|
|
|
|
|
|
|
- name: Output package versions
|
2023-03-30 20:14:06 +00:00
|
|
|
run: set -x; go version ; cargo version ; rustc --version ; cmake --version ; gcc --version ; g++ --version ; perl -v
|
2022-09-22 13:56:27 +00:00
|
|
|
|
|
|
|
- name: Run cargo build
|
2022-12-26 14:14:05 +00:00
|
|
|
run: cargo build ${{ matrix.opts }} --release --locked --target ${{ matrix.arch }}
|
2022-09-22 13:56:27 +00:00
|
|
|
env:
|
|
|
|
BINDGEN_EXTRA_CLANG_ARGS_aarch64-unknown-linux-gnu: "-I/usr/aarch64-linux-gnu/include/"
|
|
|
|
|
|
|
|
- name: Package binaries
|
|
|
|
if: ${{ !contains(matrix.arch, 'windows') }}
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
cd target/${{ matrix.arch }}/release
|
|
|
|
chmod +x surreal
|
|
|
|
tar -zcvf ${{ matrix.file }}.tgz surreal
|
|
|
|
echo $(shasum -a 256 ${{ matrix.file }}.tgz | cut -f1 -d' ') > ${{ matrix.file }}.txt
|
|
|
|
|
|
|
|
- name: Package binaries
|
|
|
|
if: ${{ contains(matrix.arch, 'windows') }}
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
cd target/${{ matrix.arch }}/release
|
|
|
|
cp surreal.exe ${{ matrix.file }}.exe
|
|
|
|
echo $(shasum -a 256 ${{ matrix.file }}.exe | cut -f1 -d' ') > ${{ matrix.file }}.txt
|
|
|
|
|
|
|
|
- name: Upload artifacts
|
2022-12-26 14:14:05 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-09-22 13:56:27 +00:00
|
|
|
with:
|
|
|
|
name: ${{ matrix.file }}
|
|
|
|
path: |
|
|
|
|
target/${{ matrix.arch }}/release/surreal
|
|
|
|
target/${{ matrix.arch }}/release/${{ matrix.file }}.tgz
|
|
|
|
target/${{ matrix.arch }}/release/${{ matrix.file }}.txt
|
|
|
|
target/${{ matrix.arch }}/release/${{ matrix.file }}.exe
|
|
|
|
|
2023-08-04 15:39:50 +00:00
|
|
|
docker:
|
|
|
|
name: Build and publish Docker image
|
2022-09-22 13:56:27 +00:00
|
|
|
needs: [build]
|
2023-08-04 15:39:50 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-09-22 13:56:27 +00:00
|
|
|
steps:
|
2023-08-04 15:39:50 +00:00
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v3
|
2022-09-22 13:56:27 +00:00
|
|
|
|
|
|
|
- name: Download amd64 binary
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
2023-09-01 10:32:44 +00:00
|
|
|
name: surreal-${{ github.ref_name }}.linux-amd64
|
2022-09-22 13:56:27 +00:00
|
|
|
path: amd64
|
|
|
|
|
|
|
|
- name: Download arm64 binary
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
2023-09-01 10:32:44 +00:00
|
|
|
name: surreal-${{ github.ref_name }}.linux-arm64
|
2022-09-22 13:56:27 +00:00
|
|
|
path: arm64
|
|
|
|
|
2023-08-04 15:39:50 +00:00
|
|
|
- name: Set file permissions
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
chmod +x amd64/surreal arm64/surreal
|
|
|
|
|
|
|
|
- name: Configure DockerHub
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
|
|
password: ${{ secrets.DOCKER_PASS }}
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
|
|
|
|
- name: Set up Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
|
|
|
- name: Configure tag
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
VERSION=${{ github.ref_name }}
|
|
|
|
echo "VERSION=${VERSION:1}" | tr + - >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Build the Docker image
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
load: true
|
|
|
|
tags: surrealdb/surrealdb:latest,surrealdb/surrealdb:${{ env.VERSION }}
|
|
|
|
|
|
|
|
# Start the docker image as server and wait until it is ready
|
|
|
|
- name: Test the Docker image
|
|
|
|
run: |
|
|
|
|
docker run --net=host --rm surrealdb/surrealdb:${{ env.VERSION }} start 2>&1 >surreal.log &
|
|
|
|
|
|
|
|
retries=5
|
|
|
|
until docker run --net=host --rm surrealdb/surrealdb:${{ env.VERSION }} is-ready; do
|
|
|
|
retries=$((retries-1))
|
|
|
|
if [[ $retries -eq 0 ]]; then
|
|
|
|
echo "###"
|
|
|
|
echo "### The container is not ready after 5 seconds!"
|
|
|
|
echo "###"
|
|
|
|
cat surreal.log
|
|
|
|
echo "###"
|
|
|
|
echo "### ERROR: The docker image is not valid. Aborting."
|
|
|
|
echo "###"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
|
|
|
# This second build reuses the cache from the build above
|
|
|
|
- name: Push the Docker image
|
|
|
|
uses: docker/build-push-action@v4
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
push: true
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
tags: surrealdb/surrealdb:latest,surrealdb/surrealdb:${{ env.VERSION }}
|
|
|
|
|
|
|
|
publish:
|
|
|
|
name: Publish binaries for ${{ matrix.arch }}
|
|
|
|
needs: [docker]
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- arch: x86_64-apple-darwin
|
|
|
|
os: macos-latest
|
2023-09-01 10:32:44 +00:00
|
|
|
file: surreal-${{ github.ref_name }}.darwin-amd64
|
2023-08-04 15:39:50 +00:00
|
|
|
- arch: aarch64-apple-darwin
|
|
|
|
os: macos-latest
|
2023-09-01 10:32:44 +00:00
|
|
|
file: surreal-${{ github.ref_name }}.darwin-arm64
|
2023-08-04 15:39:50 +00:00
|
|
|
- arch: x86_64-unknown-linux-gnu
|
|
|
|
os: ubuntu-latest
|
2023-09-01 10:32:44 +00:00
|
|
|
file: surreal-${{ github.ref_name }}.linux-amd64
|
2023-08-04 15:39:50 +00:00
|
|
|
- arch: aarch64-unknown-linux-gnu
|
|
|
|
os: ubuntu-latest
|
2023-09-01 10:32:44 +00:00
|
|
|
file: surreal-${{ github.ref_name }}.linux-arm64
|
2023-08-04 15:39:50 +00:00
|
|
|
- arch: x86_64-pc-windows-msvc
|
|
|
|
os: windows-latest
|
2023-09-01 10:32:44 +00:00
|
|
|
file: surreal-${{ github.ref_name }}.windows-amd64
|
2023-08-04 15:39:50 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
|
|
- name: Download artifacts
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.file }}
|
|
|
|
|
2022-09-22 13:56:27 +00:00
|
|
|
- name: Configure AWS
|
2022-12-27 12:55:00 +00:00
|
|
|
uses: aws-actions/configure-aws-credentials@v1-node16
|
2022-09-22 13:56:27 +00:00
|
|
|
with:
|
|
|
|
aws-region: us-east-2
|
|
|
|
aws-access-key-id: ${{ secrets.AMAZON_ACCESS_KEY }}
|
|
|
|
aws-secret-access-key: ${{ secrets.AMAZON_SECRET_KEY }}
|
|
|
|
|
2023-08-04 15:39:50 +00:00
|
|
|
- name: Publish non-windows binaries
|
|
|
|
if: ${{ !contains(matrix.arch, 'windows') }}
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2023-09-01 10:32:44 +00:00
|
|
|
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/${{ github.ref_name }}/
|
2023-08-04 15:39:50 +00:00
|
|
|
|
|
|
|
- name: Publish windows binaries
|
|
|
|
if: ${{ contains(matrix.arch, 'windows') }}
|
2022-09-22 13:56:27 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2023-09-01 10:32:44 +00:00
|
|
|
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/${{ github.ref_name }}/
|
2023-08-04 15:39:50 +00:00
|
|
|
|
|
|
|
package-macos:
|
|
|
|
name: Package macOS universal binary
|
|
|
|
needs: [publish]
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
|
|
- name: Download amd64 binary
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
2023-09-01 10:32:44 +00:00
|
|
|
name: surreal-${{ github.ref_name }}.darwin-amd64
|
2023-08-04 15:39:50 +00:00
|
|
|
path: amd64
|
|
|
|
|
|
|
|
- name: Download arm64 binary
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
2023-09-01 10:32:44 +00:00
|
|
|
name: surreal-${{ github.ref_name }}.darwin-arm64
|
2023-08-04 15:39:50 +00:00
|
|
|
path: arm64
|
|
|
|
|
|
|
|
- name: Configure AWS
|
|
|
|
uses: aws-actions/configure-aws-credentials@v1-node16
|
|
|
|
with:
|
|
|
|
aws-region: us-east-2
|
|
|
|
aws-access-key-id: ${{ secrets.AMAZON_ACCESS_KEY }}
|
|
|
|
aws-secret-access-key: ${{ secrets.AMAZON_SECRET_KEY }}
|
|
|
|
|
|
|
|
- name: Package universal MacOS binary
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2023-09-01 10:32:44 +00:00
|
|
|
FILE="surreal-${{ github.ref_name }}.darwin-universal"
|
2022-09-22 13:56:27 +00:00
|
|
|
lipo -create -output surreal amd64/surreal arm64/surreal
|
|
|
|
chmod +x surreal
|
|
|
|
tar -zcvf $FILE.tgz surreal
|
|
|
|
echo $(shasum -a 256 $FILE.tgz | cut -f1 -d' ') > $FILE.txt
|
2023-09-01 10:32:44 +00:00
|
|
|
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/${{ github.ref_name }}/
|
2022-09-22 13:56:27 +00:00
|
|
|
|
|
|
|
deploy:
|
|
|
|
name: Deploy
|
2023-08-04 15:39:50 +00:00
|
|
|
needs: [publish, package-macos]
|
|
|
|
runs-on: ubuntu-latest
|
2022-09-22 13:56:27 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checkout sources
|
2022-12-26 14:14:05 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-09-22 13:56:27 +00:00
|
|
|
|
|
|
|
- name: Configure AWS
|
2022-12-27 12:55:00 +00:00
|
|
|
uses: aws-actions/configure-aws-credentials@v1-node16
|
2022-09-22 13:56:27 +00:00
|
|
|
with:
|
|
|
|
aws-region: us-east-2
|
|
|
|
aws-access-key-id: ${{ secrets.AMAZON_ACCESS_KEY }}
|
|
|
|
aws-secret-access-key: ${{ secrets.AMAZON_SECRET_KEY }}
|
|
|
|
|
|
|
|
- name: Download artifacts
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
|
|
|
|
- name: Publish release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
|
|
|
name: "Release ${{ github.ref_name }}"
|
|
|
|
files: |
|
|
|
|
LICENSE
|
|
|
|
**/*.tgz
|
|
|
|
**/*.exe
|
|
|
|
|
|
|
|
- name: Set version
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo ${{ github.ref_name }} > latest.txt
|
|
|
|
aws s3 cp --cache-control 'no-store' latest.txt s3://download.surrealdb.com/
|
|
|
|
|
|
|
|
- name: Distribute binaries
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
regions=("af-south-1" "ap-east-1" "ap-south-1" "ap-southeast-1" "ap-southeast-2" "ca-central-1" "eu-central-1" "eu-west-2" "me-south-1" "sa-east-1" "us-west-2")
|
|
|
|
for region in ${regions[@]}; do
|
|
|
|
aws s3 sync --delete --storage-class INTELLIGENT_TIERING --source-region eu-west-2 --region ${region} s3://download.surrealdb.com s3://download.${region}.surrealdb.com
|
|
|
|
done
|