Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload files with GCP #5019

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 0 additions & 78 deletions .github/workflows/build_rust_docs.yaml

This file was deleted.

82 changes: 0 additions & 82 deletions .github/workflows/build_toolchain.yaml

This file was deleted.

89 changes: 0 additions & 89 deletions .github/workflows/ci.yaml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/cifuzz.yml

This file was deleted.

87 changes: 87 additions & 0 deletions .github/workflows/ent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Ent

on:
push:
branches: [main]
pull_request:
branches: [main]

# See https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#example-using-concurrency-to-cancel-any-in-progress-job-or-run
# cc
# xx
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
xtask:
runs-on: ubuntu-20.04
timeout-minutes: 120

steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
fetch-depth: 2

- uses: 'google-github-actions/auth@v2'
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY_JSON }}

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'

- id: 'info'
name: 'info'
run: |
set -o errexit
set -o nounset
set -o xtrace
set -o pipefail

gcloud --version
gsutil --version

# - id: 'upload-file'
# name: 'upload files'
# uses: 'google-github-actions/upload-cloud-storage@v2'
# with:
# process_gcloudignore: false
# path: './buildconfigs'
# destination: 'oak-bins/${{ github.sha }}/${{ github.action }}-${{ github.run_id }}-${{ github.run_attempt }}'

- id: 'index-files'
name: 'index files'
run: |
set -o errexit
set -o nounset
set -o xtrace
set -o pipefail

bin_name=oak-bins
destination='${{ github.sha }}/${{ github.action }}-${{ github.run_id }}-${{ github.run_attempt }}'

IFS=,
files=(./buildconfigs/*)
echo $files
for file in "${files[@]}"; do
base_file_name=$(basename ${file})
echo $file
gsutil cp $file "gs://${bin_name}/${destination}/${base_file_name}"
# https://storage.googleapis.com/oak-bins/16df3ddbf14af9b0c5839aece766fb72fcc1c240/upload-file-8754169623-1/buildconfigs/key_xor_test_app.toml
# xxy
file_url="https://storage.googleapis.com/${bin_name}/${destination}/${base_file_name}"
body=$(cat <<EOF
{
"url": "${file_url}"
}
EOF
)
echo $body
curl --fail \
--request POST \
--header "Content-Type: application/json" \
--data "${body}" \
https://api.static.space/v1/snapshot
done
unset IFS
Loading
Loading