prod release #101
This file contains hidden or 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
name: prod release | |
on: | |
workflow_run: | |
workflows: ["unit tests"] | |
types: | |
- completed | |
branches: | |
- main | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.workflow_run.head_branch }} | |
- name: set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: build package | |
run: | | |
rm -rf dist/ | |
python -m pip install build | |
python -m build | |
- name: set tag name | |
shell: bash | |
run: | | |
tag_name=`python3 -c "import v03_pipeline;print(v03_pipeline.__version__)"` | |
echo "TAG_NAME=$tag_name" >> $GITHUB_ENV | |
- name: authenticate to google cloud | |
id: "auth" | |
uses: google-github-actions/auth@v0 | |
with: | |
workload_identity_provider: "${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}" | |
service_account: "${{ secrets.RUN_SA_EMAIL }}" | |
- name: "setup gcloud sdk" | |
uses: google-github-actions/setup-gcloud@v0 | |
- name: Copy files to release directory | |
shell: bash | |
run: |- | |
gcloud storage rm -r gs://seqr-luigi/releases/prod/latest/ || echo 'No latest release' | |
gcloud storage cp v03_pipeline/bin/* gs://seqr-luigi/releases/prod/latest/bin/ | |
gcloud storage cp dist/*.whl gs://seqr-luigi/releases/prod/latest/pyscripts.zip | |
gcloud storage cp v03_pipeline/bin/* gs://seqr-luigi/releases/prod/$TAG_NAME/bin/ | |
gcloud storage cp dist/*.whl gs://seqr-luigi/releases/prod/$TAG_NAME/pyscripts.zip | |
gcloud storage cp v03_pipeline/var/vep/* gs://seqr-reference-data/vep/ | |
- name: Create tag | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'refs/tags/${{ env.TAG_NAME }}', | |
sha: context.sha | |
}) |