Skip to content

Commit b9e452c

Browse files
authored
Remove upload to GCS (#1151)
1 parent 2772ab6 commit b9e452c

File tree

3 files changed

+14
-71
lines changed

3 files changed

+14
-71
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Build
22
on: [push, pull_request]
33
env:
4-
GCS_BUCKET: autobuilds.grr-response.com
5-
GCS_BUCKET_OPENAPI: autobuilds-grr-openapi
64
DOCKER_REPOSITORY: ghcr.io/google/grr
75
jobs:
86
test-ubuntu:
@@ -61,8 +59,6 @@ jobs:
6159

6260
build-ubuntu:
6361
runs-on: ubuntu-22.04
64-
env:
65-
GCS_TAG: ubuntu_64bit
6662
steps:
6763
- uses: actions/checkout@v4
6864
- uses: actions/setup-python@v5
@@ -77,18 +73,17 @@ jobs:
7773
run: |
7874
travis/install_client_builder.sh
7975
travis/build_templates.sh
80-
ls -la gcs_upload_dir
76+
ls -la installers_dir
8177
- name: Upload installers to GitHub artifacts
8278
uses: actions/upload-artifact@v4
8379
with:
8480
name: ubuntu-installers
85-
path: gcs_upload_dir/
81+
path: installers_dir/
8682
retention-days: 1
8783

8884
build-centos:
8985
runs-on: ubuntu-22.04
9086
env:
91-
GCS_TAG: centos_64bit
9287
DOCKER_IMG: grrdocker/centos7-python39
9388
DOCKER_CONTAINER: centos_64bit_container
9489
DOCKER_USER: grrbot
@@ -110,13 +105,13 @@ jobs:
110105
docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}" bash -l -c '/usr/local/bin/python3.9 -m venv "/home/${DOCKER_USER}/INSTALL"'
111106
docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}" bash -l travis/install_client_builder.sh
112107
docker exec --user "${DOCKER_USER}" "${DOCKER_CONTAINER}" bash -l travis/build_templates.sh
113-
docker exec "${DOCKER_CONTAINER}" rpm -vih gcs_upload_dir/*.rpm
114-
ls -la gcs_upload_dir
108+
docker exec "${DOCKER_CONTAINER}" rpm -vih installers_dir/*.rpm
109+
ls -la installers_dir
115110
- name: Upload installers to GitHub artifacts
116111
uses: actions/upload-artifact@v4
117112
with:
118113
name: centos-installers
119-
path: gcs_upload_dir/
114+
path: installers_dir/
120115
retention-days: 1
121116

122117
build-windows:
@@ -132,14 +127,14 @@ jobs:
132127
set -ex
133128
pip install virtualenv wheel
134129
python -u appveyor/windows_templates/build_windows_templates.py --grr_src=$GITHUB_WORKSPACE --output_dir=$GITHUB_WORKSPACE/output --test_repack_install
135-
mkdir -p gcs_upload_dir
136-
mv -v output*/* gcs_upload_dir
137-
ls -la gcs_upload_dir
130+
mkdir -p installers_dir
131+
mv -v output*/* installers_dir
132+
ls -la installers_dir
138133
- name: Upload installers to GitHub artifacts
139134
uses: actions/upload-artifact@v4
140135
with:
141136
name: windows-installers
142-
path: gcs_upload_dir/
137+
path: installers_dir/
143138
retention-days: 1
144139

145140
build-docker-image:
@@ -271,55 +266,3 @@ jobs:
271266
docker rmi ${{ env.DOCKER_REPOSITORY }}:testing
272267
docker push --all-tags ${{ env.DOCKER_REPOSITORY }}
273268
274-
upload-artifacts:
275-
if: ${{ github.event_name == 'push' }}
276-
permissions:
277-
contents: 'read'
278-
id-token: 'write'
279-
runs-on: ubuntu-22.04
280-
needs:
281-
- docker-compose-e2e-test
282-
- test-ubuntu
283-
- build-centos
284-
- build-ubuntu
285-
- build-windows
286-
- build-openapi
287-
steps:
288-
- uses: actions/checkout@v4
289-
- name: Download installers from GitHub artifacts
290-
id: download
291-
uses: actions/download-artifact@v4
292-
with:
293-
path: _artifacts
294-
- run: |
295-
ls -la _artifacts/*/
296-
COMMIT_TIME=$(git show -s --date='format-local:%Y-%m-%dT%H:%M:%SZ' --format="%cd" $GITHUB_SHA)
297-
OUTPUT_DIR=gcs_upload_dir/${COMMIT_TIME}_${GITHUB_SHA}/
298-
echo "OUTPUT_DIR=$OUTPUT_DIR" >> $GITHUB_ENV
299-
mkdir -p $OUTPUT_DIR/centos/
300-
mv -v _artifacts/centos-installers/* $OUTPUT_DIR/centos
301-
mkdir -p $OUTPUT_DIR/ubuntu/
302-
mv -v _artifacts/ubuntu-installers/* $OUTPUT_DIR/ubuntu
303-
mkdir -p $OUTPUT_DIR/windows/
304-
mv -v _artifacts/windows-installers/* $OUTPUT_DIR/windows
305-
- name: Authenticate
306-
uses: 'google-github-actions/auth@v1'
307-
with:
308-
credentials_json: ${{ secrets.GCP_SA_KEY }}
309-
export_environment_variables: true
310-
- name: Set up Cloud SDK
311-
uses: google-github-actions/setup-gcloud@v1.1.0
312-
- name: Upload installers to GCS
313-
uses: google-github-actions/upload-cloud-storage@v1.0.0
314-
with:
315-
path: gcs_upload_dir/
316-
destination: ${{ env.GCS_BUCKET }}
317-
# Omit `path` (e.g. /home/runner/deploy/) in final GCS path.
318-
parent: false
319-
- name: Upload OpenAPI to GCS
320-
uses: google-github-actions/upload-cloud-storage@v1.0.0
321-
with:
322-
path: _artifacts/openapi/
323-
destination: ${{ env.GCS_BUCKET_OPENAPI }}
324-
# Omit `path` (e.g. /home/runner/deploy/) in final GCS path.
325-
parent: false

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ __pycache__/
2121
build/
2222
dist/
2323
artifacts/*.yaml
24-
gcs_upload_dir/
24+
installers_dir/
2525
get-pip.py
2626
grr/core/grr_response_core/artifacts/*.yaml
2727
*.egg-info/

travis/build_templates.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ set -e
44

55
source "${HOME}/INSTALL/bin/activate"
66

7-
grr_client_build build --output gcs_upload_dir
7+
grr_client_build build --output installers_dir
88

99
# We only have one template on linux or OS X so using *.zip is safe here
1010
grr_client_build \
1111
--verbose \
1212
--secondary_configs grr/test/grr_response_test/test_data/dummyconfig.yaml \
1313
repack \
14-
--template gcs_upload_dir/*.zip \
15-
--output_dir gcs_upload_dir
14+
--template installers_dir/*.zip \
15+
--output_dir installers_dir
1616

1717
# We don't install on linux because we're running on travis container
1818
# infrastructure that doesn't allow for sudo (but has startup time and
@@ -22,5 +22,5 @@ grr_client_build \
2222
# just waits for the installer to be available in a cloud storage bucket for the
2323
# build, then installs it.
2424
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
25-
sudo installer -verbose -pkg gcs_upload_dir/*.pkg -target /
25+
sudo installer -verbose -pkg installers_dir/*.pkg -target /
2626
fi

0 commit comments

Comments
 (0)