Skip to content

Commit

Permalink
Merge pull request #1 from CIAT-DAPA/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
santiago123x authored Sep 20, 2024
2 parents 3232b1c + 212360a commit 89d7518
Show file tree
Hide file tree
Showing 12 changed files with 793 additions and 60 deletions.
136 changes: 136 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Devops download data

on:
push:
branches: [ "stage" ]
tags:
- 'v*'


permissions:
contents: read

jobs:

# ------- START Scripts PROCCESS -------- #

TestScripts:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Create environment
run: |
python -m venv venv
- name: Active environment
run: |
source venv/bin/activate
- name: Install dependencies
run: |
pip install -r ./requirements.txt
# - name: Run Tests
# run: |
# python -m unittest discover -s ./test/


# ------- END Scripts PROCCESS -------- #

# ------- START MERGE PROCCESS -------- #

MergeMainScripts:
needs: TestScripts
name: Merge Stage with master
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Merge stage -> master
uses: devmasx/merge-branch@master
with:
type: now
head_to_merge: ${{ github.ref }}
target_branch: master
github_token: ${{ github.token }}

# ------- END MERGE PROCCESS -------- #

# ------- START RELEASE PROCCESS -------- #

PostRelease:
needs: MergeMainScripts
name: Create Release
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
# Scripts Zip
- name: Zip artifact for deployment
run: zip -r releaseScripts.zip ./src ./shapefiles
# Upload Artifacts
- name: Upload Scripts artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: Scripts
path: releaseScripts.zip
# Generate Tagname
- name: Generate Tagname for release
id: taggerDryRun
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DRY_RUN: true
DEFAULT_BUMP: patch
RELEASE_BRANCHES : stage,master
BRANCH_HISTORY: last
# Create release
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tag_name: ${{ steps.taggerDryRun.outputs.new_tag }}
release_name: Release ${{ steps.taggerDryRun.outputs.new_tag }}
#body_path: ./body.md
body: ${{ github.event.head_commit.message }}
draft: false
prerelease: false
# Upload Assets to release
- name: Upload Release Asset Scripts
id: upload-scripts-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./releaseScripts.zip
asset_name: releaseScripts.zip
asset_content_type: application/zip
# update version setup.py
# - name: Checkout code
# uses: actions/checkout@v3
# with:
# ref: master
# - name: Update version
# run: |
# sed -i "s/version='.*'/version='${{ steps.taggerDryRun.outputs.new_tag }}'/" setup.py
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Commit changes
# uses: stefanzweifel/git-auto-commit-action@v4
# with:
# commit_message: "Update version to ${{ steps.taggerDryRun.outputs.new_tag }}"

# ------- END RELEASE PROCCESS -------- #
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ downloadedData
output
venv
src/downloadedData/__pycache__
__pycache__
__pycache__
layers
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ attrs==24.2.0
cads-api-client==1.3.2
cdsapi==0.7.3
certifi==2024.8.30
cftime==1.6.4
charset-normalizer==3.3.2
click==8.1.7
click-plugins==1.1.1
Expand All @@ -15,6 +16,7 @@ decorator==5.1.1
exceptiongroup==1.2.2
executing==2.1.0
geopandas==1.0.1
gsconfig-py3==1.0.7
idna==3.10
ipykernel==6.29.5
ipython==8.27.0
Expand All @@ -24,6 +26,7 @@ jupyter_core==5.7.2
matplotlib-inline==0.1.7
multiurl==0.3.1
nest-asyncio==1.6.0
netCDF4==1.7.1.post2
numpy==2.1.1
packaging==24.1
pandas==2.2.2
Expand All @@ -42,6 +45,7 @@ pywin32==306
pyzmq==26.2.0
rasterio==1.3.11
requests==2.32.3
rioxarray==0.17.0
shapely==2.0.6
six==1.16.0
snuggs==1.4.7
Expand All @@ -53,3 +57,4 @@ typing_extensions==4.12.2
tzdata==2024.1
urllib3==2.2.3
wcwidth==0.2.13
xarray==2024.9.0
Loading

0 comments on commit 89d7518

Please sign in to comment.