Update python-publish.yml #25
Workflow file for this run
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
name: Create Release with Images | |
on: | |
workflow_dispatch: # Allows manual triggering | |
push: | |
tags: | |
- "*.*.*" # Trigger on version tags | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write # Required for creating and uploading release assets | |
actions: write # Needed for writing actions (like creating releases) | |
id-token: write # Required for publishing or creating release assets | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: 'pip' # caching pip dependencies | |
- name: Install dependencies | |
run: | | |
pip install . | |
- name: Install graphviz | |
run: sudo apt-get install -y graphviz | |
- name: Generate Images Folder | |
run: | | |
cat kegg_pathways_completeness/pathways_data/all_pathways.txt | tr ':' '\t' | cut -f1 > list_modules.txt | |
python -m kegg_pathways_completeness.bin.plot_modules_graphs --modules-file list_modules.txt --graphs kegg_pathways_completeness/pathways_data/graphs.pkl --definitions kegg_pathways_completeness/pathways_data/all_pathways.txt -o plots --use-pydot | |
rm list_modules.txt | |
- name: Compress Folder into GZIP | |
run: | | |
tar -czf plots.tar.gz ./plots | |
- name: Create GitHub Release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: "Release ${{ github.ref_name }}" | |
body: "Automatically generated release ${{ github.ref_name }} with images." | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Archive to Release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./plots.tar.gz | |
asset_name: plots.tar.gz | |
asset_content_type: application/gzip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |