-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (79 loc) · 2.68 KB
/
createrelease.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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 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" 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