-
-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
17b1da4
commit 7d9f1dd
Showing
1 changed file
with
106 additions
and
85 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,12 @@ on: | |
schedule: | ||
- cron: "0 0 * * 0" | ||
workflow_dispatch: # manual trigger | ||
push: | ||
branches: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
defaults: | ||
run: | ||
|
@@ -27,10 +33,25 @@ jobs: | |
env: | ||
KEY_SECRET_JSON: ${{ secrets.ZENODO_KEY_SECRET_JSON }} | ||
|
||
- name: Setup environment | ||
uses: ./.github/actions/setup_env | ||
with: | ||
os-label: linux-64 | ||
- name: Download Lock File | ||
run: wget -q https://raw.githubusercontent.com/tardis-sn/tardis/master/conda-linux-64.lock | ||
shell: bash | ||
|
||
- name: Generate Cache Key | ||
run: | | ||
file_hash=$(cat conda-linux-64.lock | shasum -a 256 | cut -d' ' -f1) | ||
echo "file_hash=$file_hash" >> "${GITHUB_OUTPUT}" | ||
id: cache-environment-key | ||
shell: bash | ||
|
||
- uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: conda-linux-64.lock | ||
cache-environment-key: ${{ steps.cache-environment-key.outputs.file_hash }} | ||
cache-downloads-key: ${{ steps.cache-environment-key.outputs.file_hash }} | ||
environment-name: tardis | ||
cache-environment: true | ||
cache-downloads: true | ||
|
||
- name: Run Notebook | ||
run: jupyter nbconvert gather_data.ipynb --to html --execute --ExecutePreprocessor.timeout=6000 | ||
|
@@ -44,84 +65,84 @@ jobs: | |
name: zenodo_json | ||
path: .zenodo.json | ||
|
||
pull_request: | ||
needs: zenodo | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
path: /tmp | ||
|
||
- name: Copy zenodo.json to repository | ||
run: | | ||
cp /tmp/zenodo_json/.zenodo.json . | ||
- name: Get current date | ||
run: echo "DATE=$(date +'%Y.%m.%d')" >> $GITHUB_ENV | ||
|
||
- uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.BOT_TOKEN }} | ||
committer: TARDIS Bot <[email protected]> | ||
author: TARDIS Bot <[email protected]> | ||
branch: pre-release-${{ env.DATE }} | ||
base: master | ||
push-to-fork: tardis-bot/tardis | ||
commit-message: Automated changes for pre-release ${{ env.DATE }} | ||
title: Pre-release ${{ env.DATE }} | ||
body: | | ||
*\*beep\* \*bop\** | ||
Hi, human. | ||
I prepared everything for a new TARDIS release. | ||
<br> | ||
> :warning: **WARNING:** | ||
> | ||
> This pull request should be auto-merged. **Do not merge manually if any check fails**. | ||
> | ||
> Instead, disable auto-merge and push your fixes to the [`pre-release-${{ env.DATE }}`](https://github.com/tardis-bot/tardis/tree/pre-release-${{ env.DATE }}) branch on [**tardis-bot/tardis**](https://github.com/tardis-bot/tardis). | ||
> | ||
> ``` | ||
> $ git remote add tardis-bot [email protected]:tardis-bot/tardis.git | ||
> $ git fetch tardis-bot | ||
> $ git checkout tardis-bot/pre-release-${{ env.DATE }} | ||
> $ git add <file_1> <file_2> ... | ||
> $ git commit -m "<your_commit_message>" | ||
> $ git push tardis-bot HEAD:pre-release-${{ env.DATE }} | ||
> ``` | ||
> | ||
> Once all the checks pass, you can safely merge this pull request manually. | ||
labels: automated, build-docs | ||
team-reviewers: tardis-infrastructure | ||
id: create-pr | ||
|
||
- name: Wait for pull request | ||
run: sleep 30 | ||
|
||
- name: Approve pull request (I) | ||
run: gh pr review ${{ steps.create-pr.outputs.pull-request-number }} --approve | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.INFRASTRUCTURE_COORDINATOR_TOKEN }} | ||
if: steps.create-pr.outputs.pull-request-operation == 'created' | ||
|
||
- name: Approve pull request (II) | ||
run: gh pr review ${{ steps.create-pr.outputs.pull-request-number }} --approve | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.CORE_COORDINATOR_TOKEN }} | ||
if: steps.create-pr.outputs.pull-request-operation == 'created' | ||
|
||
- name: Enable automerge | ||
uses: peter-evans/enable-pull-request-automerge@v2 | ||
with: | ||
token: ${{ secrets.INFRASTRUCTURE_COORDINATOR_TOKEN }} | ||
pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }} | ||
merge-method: squash | ||
if: steps.create-pr.outputs.pull-request-operation == 'created' | ||
|
||
compare_refdata: | ||
uses: tardis-sn/tardis-refdata/.github/workflows/compare-refdata.yml@master | ||
# pull_request: | ||
# needs: zenodo | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
|
||
# - uses: actions/download-artifact@v4 | ||
# with: | ||
# path: /tmp | ||
|
||
# - name: Copy zenodo.json to repository | ||
# run: | | ||
# cp /tmp/zenodo_json/.zenodo.json . | ||
|
||
# - name: Get current date | ||
# run: echo "DATE=$(date +'%Y.%m.%d')" >> $GITHUB_ENV | ||
|
||
# - uses: peter-evans/create-pull-request@v4 | ||
# with: | ||
# token: ${{ secrets.BOT_TOKEN }} | ||
# committer: TARDIS Bot <[email protected]> | ||
# author: TARDIS Bot <[email protected]> | ||
# branch: pre-release-${{ env.DATE }} | ||
# base: master | ||
# push-to-fork: tardis-bot/tardis | ||
# commit-message: Automated changes for pre-release ${{ env.DATE }} | ||
# title: Pre-release ${{ env.DATE }} | ||
# body: | | ||
# *\*beep\* \*bop\** | ||
|
||
# Hi, human. | ||
|
||
# I prepared everything for a new TARDIS release. | ||
|
||
# <br> | ||
|
||
# > :warning: **WARNING:** | ||
# > | ||
# > This pull request should be auto-merged. **Do not merge manually if any check fails**. | ||
# > | ||
# > Instead, disable auto-merge and push your fixes to the [`pre-release-${{ env.DATE }}`](https://github.com/tardis-bot/tardis/tree/pre-release-${{ env.DATE }}) branch on [**tardis-bot/tardis**](https://github.com/tardis-bot/tardis). | ||
# > | ||
# > ``` | ||
# > $ git remote add tardis-bot [email protected]:tardis-bot/tardis.git | ||
# > $ git fetch tardis-bot | ||
# > $ git checkout tardis-bot/pre-release-${{ env.DATE }} | ||
# > $ git add <file_1> <file_2> ... | ||
# > $ git commit -m "<your_commit_message>" | ||
# > $ git push tardis-bot HEAD:pre-release-${{ env.DATE }} | ||
# > ``` | ||
# > | ||
# > Once all the checks pass, you can safely merge this pull request manually. | ||
# labels: automated, build-docs | ||
# team-reviewers: tardis-infrastructure | ||
# id: create-pr | ||
|
||
# - name: Wait for pull request | ||
# run: sleep 30 | ||
|
||
# - name: Approve pull request (I) | ||
# run: gh pr review ${{ steps.create-pr.outputs.pull-request-number }} --approve | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.INFRASTRUCTURE_COORDINATOR_TOKEN }} | ||
# if: steps.create-pr.outputs.pull-request-operation == 'created' | ||
|
||
# - name: Approve pull request (II) | ||
# run: gh pr review ${{ steps.create-pr.outputs.pull-request-number }} --approve | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.CORE_COORDINATOR_TOKEN }} | ||
# if: steps.create-pr.outputs.pull-request-operation == 'created' | ||
|
||
# - name: Enable automerge | ||
# uses: peter-evans/enable-pull-request-automerge@v2 | ||
# with: | ||
# token: ${{ secrets.INFRASTRUCTURE_COORDINATOR_TOKEN }} | ||
# pull-request-number: ${{ steps.create-pr.outputs.pull-request-number }} | ||
# merge-method: squash | ||
# if: steps.create-pr.outputs.pull-request-operation == 'created' | ||
|
||
# compare_refdata: | ||
# uses: tardis-sn/tardis-refdata/.github/workflows/compare-refdata.yml@master |