Skip to content

Commit d093c31

Browse files
authored
Merge pull request #79 from MiraGeoscience/release/0.2.0
GEOPY-1952: publish official release of each package
2 parents b1114fb + 0396a6c commit d093c31

30 files changed

+903
-865
lines changed

.github/workflows/issue_to_jira.yml

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,12 @@
1-
# This workflow will create a JIRA issue upon creation of a GitHub issue
2-
31
name: Create JIRA issue
42

53
on:
64
issues:
75
types: [opened]
86

97
jobs:
10-
new_jira_issue:
11-
runs-on: ubuntu-latest
12-
13-
steps:
14-
- name: JIRA Login
15-
uses: atlassian/gajira-login@v3.0.1
16-
env:
17-
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
18-
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
19-
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
20-
- name: Jira Create issue
21-
id: create_jira_issue
22-
uses: atlassian/gajira-create@v3.0.1
23-
with:
24-
project: GEOPY
25-
issuetype: Story
26-
summary: ${{ github.event.issue.title }}
27-
description: "_from [GitHub issue #${{ github.event.issue.number }}|${{ github.event.issue.html_url }}]_"
28-
# Additional fields in JSON format
29-
fields: '{"components": [{"name": "param-sweeps"}]}'
30-
- name: Post JIRA link
31-
uses: peter-evans/create-or-update-comment@v3
32-
with:
33-
# The number of the issue or pull request in which to create a comment.
34-
issue-number: ${{ github.event.issue.number }}
35-
# The comment body.
36-
body: "JIRA issue [${{ steps.create_jira_issue.outputs.issue }}] was created."
8+
call-workflow-create-jira-issue:
9+
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-issue_to_jira.yml@main
10+
secrets: inherit
11+
with:
12+
project_key: 'GEOPY'
Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,10 @@
1-
# This workflow will comment the PR with the JIRA issue summary
2-
# if a JIRA issue number is detected in the branch name or title
3-
41
name: Add JIRA issue summary
52

63
on:
74
pull_request_target:
85
types: [opened]
96

107
jobs:
11-
add_jira_summary:
12-
runs-on: ubuntu-latest
13-
14-
steps:
15-
- name: Find JIRA issue key
16-
id: find_jira_key
17-
env:
18-
HEAD_REF: ${{ github.head_ref}}
19-
PR_TITLE: ${{ github.event.pull_request.title }}
20-
run: >
21-
echo $HEAD_REF $PR_TITLE
22-
| echo "issue_key=$(
23-
grep -osi "\b\(GA\|GEOPY\|DEVOPS\)[ #-]*[0-9]\+"
24-
| head -n1
25-
| sed -E "s/([A-Z]+)[-# ]*([0-9]+)/\1-\2/i"
26-
| tr [:lower:] [:upper:]
27-
)"
28-
>> $GITHUB_OUTPUT
29-
- name: Get JIRA summary
30-
id: get_jira_summary
31-
if: ${{ steps.find_jira_key.outputs.issue_key }}
32-
env:
33-
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
34-
JIRA_BASIC_AUTH: ${{ secrets.JIRA_BASIC_AUTH }}
35-
run: >
36-
curl -sS -X GET
37-
-H "Authorization: Basic $JIRA_BASIC_AUTH"
38-
-H "Content-Type: application/json"
39-
"$JIRA_BASE_URL/rest/api/2/issue/${{ steps.find_jira_key.outputs.issue_key }}"
40-
| echo "summary=$(jq -r '.fields.summary // empty')" >> $GITHUB_OUTPUT
41-
- name: Extract PR title
42-
id: get_pr_title
43-
env:
44-
PR_TITLE: ${{ github.event.pull_request.title }}
45-
run: |
46-
echo "text=$(echo $PR_TITLE | sed -E "s/^\s*[?[A-Z]+[-# ]*[0-9]+]?[-: ]*(.*)/\1/i")" >> $GITHUB_OUTPUT
47-
- name: Add comment
48-
if: ${{ steps.find_jira_key.outputs.issue_key }}
49-
env:
50-
ISSUE_SUMMARY: ${{ steps.get_jira_summary.outputs.summary }}
51-
TITLE_TEXT: ${{ steps.get_pr_title.outputs.text }}
52-
PR_BODY: ${{ github.event.pull_request.body }}
53-
run: >
54-
jq
55-
--arg ISSUE_ID "${{ steps.find_jira_key.outputs.issue_key }}"
56-
--arg ISSUE_SUMMARY "$(cat <<< $ISSUE_SUMMARY)"
57-
--arg TITLE_TEXT "$(cat <<< ${TITLE_TEXT:-$ISSUE_SUMMARY})"
58-
--arg PR_BODY "$(cat <<< $PR_BODY)"
59-
-c '{"title": ($ISSUE_ID + ": " + $TITLE_TEXT), "body": ("**" + $ISSUE_ID + " - " + $ISSUE_SUMMARY + "**\n" + $PR_BODY)}' <<< {}
60-
| curl -sS -X POST -d @-
61-
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}"
62-
-H "Content-Type: application/json"
63-
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls/${{ github.event.pull_request.number }}"
64-
> /dev/null
8+
call-workflow-add-jira-issue-summary:
9+
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-pr_add_jira_summary.yml@main
10+
secrets: inherit

.github/workflows/pytest-unix-os.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.github/workflows/pytest-windows.yml

Lines changed: 0 additions & 70 deletions
This file was deleted.

.github/workflows/python_analysis.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Python analysis
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
branches:
7+
- develop
8+
- main
9+
- release/**
10+
- feature/**
11+
- hotfix/**
12+
push:
13+
branches:
14+
- develop
15+
- main
16+
- release/**
17+
- feature/**
18+
- hotfix/**
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
call-workflow-static-analysis:
26+
name: Static analysis
27+
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-static_analysis.yml@main
28+
with:
29+
package-manager: 'poetry'
30+
app-name: 'param_sweeps'
31+
python-version: '3.10'
32+
call-workflow-pytest:
33+
name: Pytest
34+
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-pytest.yml@main
35+
with:
36+
package-manager: 'poetry'
37+
python-versions: '["3.10", "3.11", "3.12"]'
38+
os: '["ubuntu-latest", "windows-latest"]'
39+
cache-number: 1
40+
codecov-reference-python-version: '3.10'
41+
codecov-reference-os: '["windows-latest"]'
42+
secrets:
43+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy python package in development
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Push events to every version tag (eg. v1.0.0)
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
call-workflow-conda-publish:
14+
name: Publish development conda package on JFrog Artifactory
15+
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_conda_package.yml@main
16+
with:
17+
package-name: 'param-sweeps'
18+
python-version: '3.10'
19+
virtual-repo-names: '["public-conda-dev"]'
20+
secrets:
21+
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
22+
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
23+
call-workflow-pypi-publish:
24+
name: Publish development pypi package (JFrog Artifactory, TestPyPI)
25+
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_pypi_package.yml@main
26+
with:
27+
package-manager: 'poetry'
28+
package-name: 'param-sweeps'
29+
version-tag: ${{ github.ref_name }}
30+
python-version: '3.10'
31+
virtual-repo-names: '["public-pypi-dev", "test-pypi"]'
32+
secrets:
33+
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
34+
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
35+
PYPI_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Deploy python package in production
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
release-tag:
9+
description: 'Tag for the existing (draft) release to publish assets from'
10+
required: true
11+
publish-conda:
12+
description: 'Publish Conda package'
13+
required: false
14+
default: true
15+
publish-pypi:
16+
description: 'Publish PyPI package'
17+
required: false
18+
default: true
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.event.release.tag_name || github.event.inputs.release-tag || github.run_id }}
22+
cancel-in-progress: true
23+
24+
jobs:
25+
call-workflow-conda-release:
26+
name: Publish production Conda package on JFrog Artifactory
27+
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_conda_assets.yml@main
28+
if: ${{ github.event_name == 'release' || github.event.inputs.publish-conda == 'true' }}
29+
with:
30+
virtual-repo-names: '["public-conda-prod"]'
31+
release-tag: ${{ github.event.release.tag_name || github.event.inputs.release-tag }}
32+
secrets:
33+
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
34+
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
35+
call-workflow-pypi-release:
36+
name: Publish production PyPI package (JFrog Artifactory, PyPI)
37+
if: ${{ github.event_name == 'release' || github.event.inputs.publish-pypi == 'true' }}
38+
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_pypi_assets.yml@main
39+
with:
40+
package-name: 'param-sweeps'
41+
virtual-repo-names: '["public-pypi-prod", "pypi"]'
42+
release-tag: ${{ github.event.release.tag_name || github.event.inputs.release-tag }}
43+
secrets:
44+
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
45+
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
46+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)