fix to match the new script names #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: Upload Release Tarball and Container | |
on: | |
push: | |
tags: | |
- '*' # Push events of any tag created | |
jobs: | |
build_versioned_container: | |
name: Build and Push versioned container | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Setup mamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
init-shell: bash | |
generate-run-shell: true | |
environment-file: resources/harpy.yaml | |
cache-environment: false | |
post-cleanup: 'all' | |
- name: Install harpy | |
shell: micromamba-shell {0} | |
run: | | |
python3 -m pip install --upgrade build && python3 -m build | |
pip install dist/*.whl | |
resources/buildforCI.sh | |
- name: Clear space | |
run: rm -rf /opt/hostedtoolcache | |
- name: Recreate container | |
shell: micromamba-shell {0} | |
run: harpy containerize | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: pdimens/harpy:${{ github.ref_name }} | |
build_tarball: | |
name: Upload Release Tarball | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
repository-projects: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Version the Container | |
# this removes the :latest tag and replaces with versioned container | |
run: | | |
for i in src/harpy/snakefiles/*.smk; do | |
sed -i "s/harpy\:latest/harpy\:${{ github.ref_name }}/g" $i | |
done | |
- name: Bump Harpy Version | |
# this removes the :latest tag and replaces with versioned container | |
run: | | |
sed -i "s/0\.0\.0/${{ github.ref_name }}/g" src/harpy/__main__.py | |
sed -i "s/0\.0\.0/${{ github.ref_name }}/g" pyproject.toml | |
- name: Build project | |
# This builds the release tarball, stripped of unneccessary things | |
run: | | |
mkdir artifacts | |
tar --exclude="test" --exclude=".deprecated" --exclude="artifacts" --exclude=".git" --exclude=".github" -zcvf artifacts/harpy.${{ github.ref_name }}.tar.gz . | |
- name: Create Release with Assets | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: ./artifacts/harpy.${{ github.ref_name }}.tar.gz | |
# - name: Create Release | |
# id: create_release | |
# uses: actions/create-release@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# tag_name: ${{ github.ref }} | |
# release_name: harpy v${{ github.ref }} | |
# draft: false | |
# prerelease: false | |
# - name: Upload Release Asset | |
# id: upload-release-asset | |
# uses: actions/upload-release-asset@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# # This pulls from the CREATE RELEASE step above, referencing its ID to get its outputs object, which include a `upload_url` | |
# upload_url: ${{ steps.create_release.outputs.upload_url }} | |
# asset_path: ./artifacts/harpy.${{ github.ref_name }}.tar.gz | |
# asset_name: harpy.${{ github.ref_name }}.tar.gz | |
# asset_content_type: application/zip |