Skip to content

Commit

Permalink
Merge pull request #88 from MiraGeoscience/release/3.3.0
Browse files Browse the repository at this point in the history
Release/3.3.0
  • Loading branch information
sebhmg authored Feb 8, 2025
2 parents eb43f8e + 8215583 commit 6154e0c
Show file tree
Hide file tree
Showing 50 changed files with 1,516 additions and 1,290 deletions.
34 changes: 5 additions & 29 deletions .github/workflows/issue_to_jira.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,12 @@
# This workflow will create a JIRA issue upon creation of a GitHub issue

name: Create JIRA issue

on:
issues:
types: [opened]

jobs:
new_jira_issue:
runs-on: ubuntu-latest

steps:
- name: JIRA Login
uses: atlassian/[email protected]
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
- name: Jira Create issue
id: create_jira_issue
uses: atlassian/[email protected]
with:
project: GEOPY
issuetype: Story
summary: ${{ github.event.issue.title }}
description: "_from [GitHub issue #${{ github.event.issue.number }}|${{ github.event.issue.html_url }}]_"
# Additional fields in JSON format
fields: '{"components": [{"name": "OMF"}]}'
- name: Post JIRA link
uses: peter-evans/create-or-update-comment@v3
with:
# The number of the issue or pull request in which to create a comment.
issue-number: ${{ github.event.issue.number }}
# The comment body.
body: "JIRA issue [${{ steps.create_jira_issue.outputs.issue }}] was created."
call-workflow-create-jira-issue:
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-issue_to_jira.yml@main
secrets: inherit
with:
project-key: 'GEOPY'
60 changes: 3 additions & 57 deletions .github/workflows/pr_add_jira_summary.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,10 @@
# This workflow will comment the PR with the JIRA issue summary
# if a JIRA issue number is detected in the branch name or title

name: Add JIRA issue summary

on:
pull_request_target:
types: [opened]

jobs:
add_jira_summary:
runs-on: ubuntu-latest

steps:
- name: Find JIRA issue key
id: find_jira_key
env:
HEAD_REF: ${{ github.head_ref}}
PR_TITLE: ${{ github.event.pull_request.title }}
run: >
echo $HEAD_REF $PR_TITLE
| echo "issue_key=$(
grep -osi "\b\(GA\|GEOPY\|DEVOPS\)[ #-]*[0-9]\+"
| head -n1
| sed -E "s/([A-Z]+)[-# ]*([0-9]+)/\1-\2/i"
| tr [:lower:] [:upper:]
)"
>> $GITHUB_OUTPUT
- name: Get JIRA summary
id: get_jira_summary
if: ${{ steps.find_jira_key.outputs.issue_key }}
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_BASIC_AUTH: ${{ secrets.JIRA_BASIC_AUTH }}
run: >
curl -sS -X GET
-H "Authorization: Basic $JIRA_BASIC_AUTH"
-H "Content-Type: application/json"
"$JIRA_BASE_URL/rest/api/2/issue/${{ steps.find_jira_key.outputs.issue_key }}"
| echo "summary=$(jq -r '.fields.summary // empty')" >> $GITHUB_OUTPUT
- name: Extract PR title
id: get_pr_title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
echo "text=$(echo $PR_TITLE | sed -E "s/^\s*[?[A-Z]+[-# ]*[0-9]+]?[-: ]*(.*)/\1/i")" >> $GITHUB_OUTPUT
- name: Add comment
if: ${{ steps.find_jira_key.outputs.issue_key }}
env:
ISSUE_SUMMARY: ${{ steps.get_jira_summary.outputs.summary }}
TITLE_TEXT: ${{ steps.get_pr_title.outputs.text }}
PR_BODY: ${{ github.event.pull_request.body }}
run: >
jq
--arg ISSUE_ID "${{ steps.find_jira_key.outputs.issue_key }}"
--arg ISSUE_SUMMARY "$(cat <<< $ISSUE_SUMMARY)"
--arg TITLE_TEXT "$(cat <<< ${TITLE_TEXT:-$ISSUE_SUMMARY})"
--arg PR_BODY "$(cat <<< $PR_BODY)"
-c '{"title": ($ISSUE_ID + ": " + $TITLE_TEXT), "body": ("**" + $ISSUE_ID + " - " + $ISSUE_SUMMARY + "**\n" + $PR_BODY)}' <<< {}
| curl -sS -X POST -d @-
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}"
-H "Content-Type: application/json"
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/pulls/${{ github.event.pull_request.number }}"
> /dev/null
call-workflow-add-jira-issue-summary:
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-pr_add_jira_summary.yml@main
secrets: inherit
64 changes: 0 additions & 64 deletions .github/workflows/pytest-unix-os.yml

This file was deleted.

70 changes: 0 additions & 70 deletions .github/workflows/pytest-windows.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/python_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Python analysis

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- develop
- main
- release/**
- feature/**
- hotfix/**
push:
branches:
- develop
- main
- release/**
- feature/**
- hotfix/**

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
call-workflow-static-analysis:
name: Static analysis
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-static_analysis.yml@main
with:
package-manager: 'poetry'
app-name: 'omf'
python-version: '3.10'
call-workflow-pytest:
name: Pytest
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-pytest.yml@main
with:
package-manager: 'poetry'
python-versions: '["3.10", "3.11", "3.12"]'
os: '["ubuntu-latest", "windows-latest"]'
cache-number: 1
codecov-reference-python-version: '3.10'
codecov-reference-os: '["windows-latest"]'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/python_deploy_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy python package in development

on:
push:
tags:
- 'v*' # Push events to every version tag (eg. v1.0.0)

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

jobs:
call-workflow-conda-publish:
name: Publish development conda package on JFrog Artifactory
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_conda_package.yml@main
with:
package-name: 'mira-omf'
python-version: '3.10'
virtual-repo-names: '["public-conda-dev"]'
secrets:
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
call-workflow-pypi-publish:
name: Publish development pypi package (JFrog Artifactory, TestPyPI)
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_pypi_package.yml@main
with:
package-manager: 'poetry'
package-name: 'mira-omf'
version-tag: ${{ github.ref_name }}
python-version: '3.10'
virtual-repo-names: '["public-pypi-dev", "test-pypi"]'
secrets:
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
PYPI_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}
46 changes: 46 additions & 0 deletions .github/workflows/python_deploy_prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy python package in production

on:
release:
types: [published]
workflow_dispatch:
inputs:
release-tag:
description: 'Tag for the existing (draft) release to publish assets from'
required: true
publish-conda:
description: 'Publish Conda package'
required: false
default: true
publish-pypi:
description: 'Publish PyPI package'
required: false
default: true

concurrency:
group: ${{ github.workflow }}-${{ github.event.release.tag_name || github.event.inputs.release-tag || github.run_id }}
cancel-in-progress: true

jobs:
call-workflow-conda-release:
name: Publish production Conda package on JFrog Artifactory
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_conda_assets.yml@main
if: ${{ github.event_name == 'release' || github.event.inputs.publish-conda == 'true' }}
with:
virtual-repo-names: '["public-conda-prod"]'
release-tag: ${{ github.event.release.tag_name || github.event.inputs.release-tag }}
secrets:
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
call-workflow-pypi-release:
name: Publish production PyPI package (JFrog Artifactory, PyPI)
if: ${{ github.event_name == 'release' || github.event.inputs.publish-pypi == 'true' }}
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_pypi_assets.yml@main
with:
package-name: 'mira-omf'
virtual-repo-names: '["public-pypi-prod", "pypi"]'
release-tag: ${{ github.event.release.tag_name || github.event.inputs.release-tag }}
secrets:
JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }}
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
Loading

0 comments on commit 6154e0c

Please sign in to comment.