-
Notifications
You must be signed in to change notification settings - Fork 9
65 lines (59 loc) · 2.25 KB
/
create_info.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: Create info files
on:
workflow_dispatch:
inputs:
directory:
default: "anvil-rstudio-bioconductor"
required: true
version:
required: false
description: "Overwrite tag, defaults to VERSION file"
jobs:
build:
name: Generate info json file for Broad GCR container
runs-on: ubuntu-latest
steps:
- name: Free root space
uses: almahmoud/free-root-space@v1
with:
verbose: true
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Generate info JSON with Broad script
continue-on-error: true
run: |
mkdir -p ${{ inputs.directory }}/info
mkdir -p /tmp/${{ inputs.directory }}
CURR_VERSION="${{ inputs.version }}"
if [ -z "$CURR_VERSION" ]; then
CURR_VERSION=$(cat ${{ inputs.directory }}/VERSION)
fi
echo "Used version is $CURR_VERSION"
docker run --name ${{ inputs.directory }} -d us.gcr.io/broad-dsp-gcr-public/${{ inputs.directory }}:${CURR_VERSION}
sed -i "s/##${{ inputs.directory }}-VERSION##/${CURR_VERSION}/g" config/conf.json
bash scripts/generate_packages.sh ${{ inputs.directory }}
- name: Copy to tmp before retry
run: |
# Remove spaces
(cd ${{ inputs.directory }}/info && for file in *; do [[ "$file" == *" "* ]] && mv "$file" "${file// /}"; done) || true
cp -r ${{ inputs.directory }}/info /tmp/${{ inputs.directory }}/
- name: Push info
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 50
shell: bash
command: |
set -x
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git pull origin ${GITHUB_REF#refs/heads/} || git reset --hard origin/${GITHUB_REF#refs/heads/}
git config user.name github-actions
git config user.email [email protected]
cp -r /tmp/${{ inputs.directory }}/info ${{ inputs.directory }}/
git add ${{ inputs.directory }}
git commit -m "Generated info for ${{ inputs.directory }}"
git push