11name : Build
22on : [push, pull_request]
33env :
4- GCS_BUCKET : autobuilds.grr-response.com
5- GCS_BUCKET_OPENAPI : autobuilds-grr-openapi
64 DOCKER_REPOSITORY : ghcr.io/google/grr
75jobs :
86 test-ubuntu :
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
0 commit comments