Skip to content

Commit e48ba5b

Browse files
authored
Merge branch 'main' into add-2021_Delser_SciData
2 parents a606a55 + 300e0df commit e48ba5b

12 files changed

+3475
-3327
lines changed

.github/workflows/create_package_recipe.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
types: [created]
55

66
jobs:
7-
deploy:
7+
create_recipe:
88
# Only run if comment is on a PR with the main repo, and if it contains the magic keywords
99
if: >
1010
contains(github.event.comment.html_url, '/pull/') &&
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Rename package recipe
2+
on:
3+
issue_comment:
4+
types: [created]
5+
6+
jobs:
7+
rename_package:
8+
runs-on: ubuntu-latest
9+
# Only run if comment is on a PR and if it contains the magic keywords
10+
# Ensure the comment starts with "@delphis-bot rename" and is made by TCLamnidis
11+
if: >
12+
contains(github.event.comment.html_url, '/pull/') &&
13+
startsWith(github.event.comment.body, '@delphis-bot rename') &&
14+
github.event.repository.full_name == 'poseidon-framework/minotaur-recipes' &&
15+
github.event.comment.user.login == 'TCLamnidis'
16+
17+
steps:
18+
# indication that the process has started
19+
- name: React on comment
20+
uses: peter-evans/create-or-update-comment@v2
21+
with:
22+
comment-id: ${{ github.event.comment.id }}
23+
reactions: rocket
24+
token: ${{ secrets.delphis_bot_org_token }}
25+
26+
# Use the @delphis-bot token to check out so we can push later
27+
- uses: actions/checkout@v4
28+
with:
29+
token: ${{ secrets.delphis_bot_org_token }}
30+
31+
# Action runs on the issue comment, so we don't get the PR by default
32+
# Use the gh cli to check out the PR
33+
- name: Checkout Pull Request
34+
run: gh pr checkout ${{ github.event.issue.number }}
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.delphis_bot_org_token }}
37+
38+
- name: Get package name from comment
39+
id: get_package_name
40+
run: |
41+
if [[ "${{ github.event.comment.body }}" =~ @delphis-bot\ rename\ ([a-zA-Z0-9_-]+)\ ([a-zA-Z0-9_-]+) ]]; then
42+
echo "target_package_name=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
43+
echo "destination_package_name=${BASH_REMATCH[2]}" >> $GITHUB_OUTPUT
44+
else
45+
echo "No package names found in comment."
46+
exit 1
47+
fi
48+
49+
- name: Check if target package exists
50+
id: target_check
51+
run: |
52+
target_exists='true'
53+
if [ ! -d "./packages/${{ steps.get_package_name.outputs.target_package_name }}" ]; then
54+
echo "Target package does not exist."
55+
target_exists='false'
56+
fi
57+
echo "target_exists=${target_exists}" >> $GITHUB_OUTPUT
58+
59+
60+
- name: Check if destination package exists
61+
id: destination_check
62+
run: |
63+
destination_free='true'
64+
if [ -d "./packages/${{ steps.get_package_name.outputs.destination_package_name }}" ]; then
65+
echo "Destination package already exists."
66+
destination_free='false'
67+
fi
68+
echo "destination_free=${destination_free}" >> $GITHUB_OUTPUT
69+
70+
## DEBUG
71+
# - name: Post debug comment
72+
# uses: peter-evans/create-or-update-comment@v2
73+
# with:
74+
# issue-number: ${{ github.event.issue.number }}
75+
# token: ${{ secrets.delphis_bot_org_token }}
76+
# body: |
77+
# Debugging information:
78+
# - Target package name: `${{ steps.get_package_name.outputs.target_package_name }}`
79+
# - Destination package name: `${{ steps.get_package_name.outputs.destination_package_name }}`
80+
# - Target package exists: `${{ steps.target_check.outputs.target_exists }}`
81+
# - Destination package exists: `${{ steps.destination_check.outputs.destination_free }}`
82+
83+
- name: Post error comment
84+
if: steps.target_check.outputs.target_exists == 'false' || steps.destination_check.outputs.destination_free == 'false'
85+
uses: peter-evans/create-or-update-comment@v2
86+
with:
87+
issue-number: ${{ github.event.issue.number }}
88+
token: ${{ secrets.delphis_bot_org_token }}
89+
body: |
90+
Error: Cannot rename package.
91+
This can be caused by one of the following reasons:
92+
- Target package `${{ steps.get_package_name.outputs.target_package_name }}` does not exist.
93+
- Destination package `${{ steps.get_package_name.outputs.destination_package_name }}` already exists.
94+
95+
- name: Rename package directory
96+
if: >
97+
steps.get_package_name.outputs.target_package_name != steps.get_package_name.outputs.destination_package_name &&
98+
steps.target_check.outputs.target_exists == 'true' &&
99+
steps.destination_check.outputs.destination_free == 'true'
100+
id: rename_package
101+
run: |
102+
mv "./packages/${{ steps.get_package_name.outputs.target_package_name }}" "./packages/${{ steps.get_package_name.outputs.destination_package_name }}"
103+
for file in ./packages/${{ steps.get_package_name.outputs.destination_package_name }}/${{ steps.get_package_name.outputs.target_package_name }}*; do
104+
mv "${file}" "${file/${{ steps.get_package_name.outputs.target_package_name }}/${{ steps.get_package_name.outputs.destination_package_name }}}"
105+
done
106+
107+
- name: Commit & push changes
108+
id: commit_changes
109+
if: steps.rename_package.outcome == 'success'
110+
run: |
111+
git config user.email "delphis-bot@poseidon-adna.org"
112+
git config user.name "delphis-bot"
113+
git config push.default upstream
114+
git add .
115+
git status
116+
git commit -m "[automated] Rename recipe from ${{ steps.get_package_name.outputs.target_package_name }} to ${{ steps.get_package_name.outputs.destination_package_name }}"
117+
git push

assets/template.config

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Keep track of config versions
2-
minotaur_release='0.5.0' // The release tag of the poseidon-eager repository used for processing and config file retrieval
3-
config_template_version='0.5.0'
4-
package_config_version='0.5.0'
2+
minotaur_release='1.0.0' // The release tag of the poseidon-eager repository used for processing and config file retrieval
3+
config_template_version='1.0.0'
4+
package_config_version='1.0.0'
55
minotaur_config_base="https://raw.githubusercontent.com/poseidon-framework/poseidon-eager/${minotaur_release}/conf"
66

77
// This configuration file is designed to be a used with the nf-core/eager pipeline.
@@ -15,7 +15,7 @@ minotaur_config_base="https://raw.githubusercontent.com/poseidon-framework/posei
1515
// single file.
1616

1717
// Load configuration profiles. They are loaded from the minotaur_config_base URL, main branch.
18-
includeConfig "${minotaur_config_base}/EVA_cluster.config" // Cluster-specific configurations for nf-core/eager execution at MPI-EVA
18+
// The loaded config includes code that loads the institutional configs from https://github.com/poseidon-framework/minotaur-institutional-configs.
1919
includeConfig "${minotaur_config_base}/Minotaur.config" // Default nf-core/eager parameters for Minotaur processing.
2020

2121
// The following config file specifies BED files for on-target endogenous DNA calculation and mean coverage as well as pseudohaploid genotyping.

packages/2021_PattersonNature/2021_PattersonNature.config

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Keep track of config versions
2-
minotaur_release='0.3.0dev' // The release tag of the poseidon-eager repository used for processing and config file retrieval
3-
config_template_version='0.3.0dev'
4-
package_config_version='0.3.0dev'
2+
minotaur_release='0.5.0' // The release tag of the poseidon-eager repository used for processing and config file retrieval
3+
config_template_version='0.5.0'
4+
package_config_version='0.5.0'
55
minotaur_config_base="https://raw.githubusercontent.com/poseidon-framework/poseidon-eager/${minotaur_release}/conf"
66

77
// This configuration file is designed to be a used with the nf-core/eager pipeline.
@@ -33,9 +33,9 @@ params {
3333
Any parameters not specified in any of the config files default to their nf-core/eager default values.
3434

3535
For information on all available parameters and their default values see:
36-
https://nf-co.re/eager/2.4.6/parameters
36+
https://nf-co.re/eager/2.5.1/parameters
3737

38-
You can see the default values for parameters within poseidon-eager at:
38+
You can see the latest default values for parameters within poseidon-eager at:
3939
https://github.com/poseidon-framework/poseidon-eager/blob/main/conf/Minotaur.config
4040
*/
4141
}

0 commit comments

Comments
 (0)