-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix server builds upload paths (#791)
* Fix build server upload paths * Test * Test * Make job create staging dir * Keep testing * Remove test entries
- Loading branch information
Showing
1 changed file
with
17 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ env: | |
CARGO_TERM_COLOR: always | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
BUILD_DIR: build-${{ github.sha }} | ||
SERVER_BINARY_NAME: ambient-${{ github.sha }} | ||
CANARY_SERVER_BINARY_NAME: ambient-0.3.0-dev | ||
|
||
|
@@ -62,7 +63,8 @@ jobs: | |
run: | | ||
raw_image_name="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:sha-${{ github.sha }}" | ||
container_id=$(docker create "${raw_image_name,,}") | ||
docker cp "$container_id:/app/ambient" "${{ env.SERVER_BINARY_NAME }}" | ||
mkdir -p "${{ env.BUILD_DIR }}" | ||
docker cp "$container_id:/app/ambient" "${{ env.BUILD_DIR }}/${{ env.SERVER_BINARY_NAME }}" | ||
docker rm "$container_id" | ||
- name: Authenticate with Google Cloud | ||
|
@@ -74,40 +76,27 @@ jobs: | |
service_account: [email protected] | ||
access_token_lifetime: 1800s | ||
|
||
- name: Upload ambient server binary | ||
uses: google-github-actions/upload-cloud-storage@v1 | ||
with: | ||
path: ${{ env.SERVER_BINARY_NAME }} | ||
destination: ambient-artifacts/ambient-server-builds | ||
|
||
- name: Upload Canary to Google Cloud | ||
- name: Prepare canary | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
uses: google-github-actions/upload-cloud-storage@v1 | ||
with: | ||
path: ${{ env.SERVER_BINARY_NAME }} | ||
destination: "ambient-artifacts/ambient-server-builds/${{ env.CANARY_SERVER_BINARY_NAME }}" | ||
parent: false | ||
shell: bash | ||
run: | ||
cp "${{ env.BUILD_DIR }}/${{ env.SERVER_BINARY_NAME }}" "${{ env.BUILD_DIR }}/${{ env.CANARY_SERVER_BINARY_NAME }}" | ||
|
||
- name: Set version | ||
- name: Prepare versioned | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV | ||
shell: bash | ||
- name: Upload version to Google Cloud | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
uses: google-github-actions/upload-cloud-storage@v1 | ||
with: | ||
path: ${{ env.SERVER_BINARY_NAME }} | ||
destination: "ambient-artifacts/ambient-server-builds/ambient-${{ env.version }}" | ||
parent: false | ||
run: | ||
cp "${{ env.BUILD_DIR }}/${{ env.SERVER_BINARY_NAME }}" "${{ env.BUILD_DIR }}/ambient-${GITHUB_REF#refs/tags/v}" | ||
|
||
- name: Set date suffix | ||
- name: Prepare nightly | ||
if: github.event_name == 'schedule' | ||
run: echo "date_suffix=$(date +%Y-%m-%d)" >> $GITHUB_ENV | ||
shell: bash | ||
- name: Upload nightly to Google Cloud | ||
if: github.event_name == 'schedule' | ||
run: | ||
cp "${{ env.BUILD_DIR }}/${{ env.SERVER_BINARY_NAME }}" "${{ env.BUILD_DIR }}/ambient-nightly-$(date +%Y-%m-%d)" | ||
|
||
- name: Upload ambient server binary | ||
uses: google-github-actions/upload-cloud-storage@v1 | ||
with: | ||
path: ${{ env.SERVER_BINARY_NAME }} | ||
destination: "ambient-artifacts/ambient-server-builds/ambient-nightly-${{ env.date_suffix }}" | ||
path: ${{ env.BUILD_DIR }} | ||
destination: ambient-artifacts/ambient-server-builds | ||
parent: false |