envira 0.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. envira-0.0.0/.gitattributes +2 -0
  2. envira-0.0.0/.github/integration-test/Dockerfile-arch-sudo +30 -0
  3. envira-0.0.0/.github/integration-test/Dockerfile-arch-user +27 -0
  4. envira-0.0.0/.github/integration-test/Dockerfile-centos-sudo +31 -0
  5. envira-0.0.0/.github/integration-test/Dockerfile-centos-user +27 -0
  6. envira-0.0.0/.github/integration-test/Dockerfile-fedora-sudo +30 -0
  7. envira-0.0.0/.github/integration-test/Dockerfile-fedora-user +27 -0
  8. envira-0.0.0/.github/integration-test/Dockerfile-manjaro-sudo +30 -0
  9. envira-0.0.0/.github/integration-test/Dockerfile-manjaro-user +27 -0
  10. envira-0.0.0/.github/integration-test/Dockerfile-ubuntu-sudo +36 -0
  11. envira-0.0.0/.github/integration-test/Dockerfile-ubuntu-user +33 -0
  12. envira-0.0.0/.github/workflows/lagacy_test.yaml +30 -0
  13. envira-0.0.0/.github/workflows/release.yaml +150 -0
  14. envira-0.0.0/.github/workflows/release_web.yaml +56 -0
  15. envira-0.0.0/.github/workflows/test.yaml +23 -0
  16. envira-0.0.0/.gitignore +377 -0
  17. envira-0.0.0/CNAME +1 -0
  18. envira-0.0.0/LICENSE +661 -0
  19. envira-0.0.0/PKG-INFO +805 -0
  20. envira-0.0.0/README.md +121 -0
  21. envira-0.0.0/assets/theme_preview.jpg +0 -0
  22. envira-0.0.0/cli.py +7 -0
  23. envira-0.0.0/envira/__init__.py +7 -0
  24. envira-0.0.0/envira/__main__.py +13 -0
  25. envira-0.0.0/envira/_version.py +21 -0
  26. envira-0.0.0/envira/cli/README.md +79 -0
  27. envira-0.0.0/envira/cli/__init__.py +52 -0
  28. envira-0.0.0/envira/cli/installer.py +75 -0
  29. envira-0.0.0/envira/cli/models.py +22 -0
  30. envira-0.0.0/envira/cli/runner.py +387 -0
  31. envira-0.0.0/envira/cli/steps.py +57 -0
  32. envira-0.0.0/envira/cli/ui.py +334 -0
  33. envira-0.0.0/envira/cli/utils.py +99 -0
  34. envira-0.0.0/envira/software/__init__.py +10 -0
  35. envira-0.0.0/envira/software/base.py +50 -0
  36. envira-0.0.0/envira/software/essentials.py +533 -0
  37. envira-0.0.0/envira/util/__init__.py +8 -0
  38. envira-0.0.0/envira/util/const.py +3 -0
  39. envira-0.0.0/envira/util/impl_dispatcher.py +224 -0
  40. envira-0.0.0/envira/util/result.py +17 -0
  41. envira-0.0.0/envira.egg-info/PKG-INFO +805 -0
  42. envira-0.0.0/envira.egg-info/SOURCES.txt +56 -0
  43. envira-0.0.0/envira.egg-info/dependency_links.txt +1 -0
  44. envira-0.0.0/envira.egg-info/entry_points.txt +2 -0
  45. envira-0.0.0/envira.egg-info/requires.txt +2 -0
  46. envira-0.0.0/envira.egg-info/top_level.txt +1 -0
  47. envira-0.0.0/envira.sh +80 -0
  48. envira-0.0.0/files/jupyter.service +17 -0
  49. envira-0.0.0/files/mzz-ys.zsh-theme +87 -0
  50. envira-0.0.0/files/syncthing.service +24 -0
  51. envira-0.0.0/pixi.lock +1129 -0
  52. envira-0.0.0/pyproject.toml +69 -0
  53. envira-0.0.0/run.sh +440 -0
  54. envira-0.0.0/run_user.sh +297 -0
  55. envira-0.0.0/setup.cfg +4 -0
  56. envira-0.0.0/test/__init__.py +1 -0
  57. envira-0.0.0/test/test_impl_dispatcher.py +432 -0
  58. envira-0.0.0/test/test_modular_cli.py +185 -0
@@ -0,0 +1,2 @@
1
+ # SCM syntax highlighting & preventing 3-way merges
2
+ pixi.lock merge=binary linguist-language=YAML linguist-generated=true
@@ -0,0 +1,30 @@
1
+ # The Dockerfile to build centos with a sudo user
2
+ FROM archlinux:latest
3
+
4
+ # Install the required packages
5
+ RUN pacman -Sy --noconfirm sudo
6
+
7
+ # Create a new user
8
+ RUN useradd -m -s /bin/bash user && \
9
+ usermod -aG wheel user && \
10
+ echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
11
+
12
+ # Set the working directory
13
+ WORKDIR /home/user
14
+ COPY run.sh /home/user/run.sh
15
+
16
+ # remove the last `zsh` in the script to prevent the endless runtime
17
+ RUN echo "" >> ./run.sh
18
+ RUN tac run.sh | awk '/^zsh$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
19
+
20
+ # remove the line `systemctl --user start syncthing.service`
21
+ RUN tac run.sh | awk '/^systemctl --user start syncthing.service$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
22
+
23
+ # remove the line `docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:latest`
24
+ RUN tac run.sh | awk '/^docker run -d -p 9001:9001 --name portainer_agent --restart=always -v \/var\/run\/docker.sock:\/var\/run\/docker.sock -v \/var\/lib\/docker\/volumes:\/var\/lib\/docker\/volumes portainer\/agent:latest$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
25
+
26
+ # Set the user
27
+ USER user
28
+
29
+ # Set the entrypoint
30
+ CMD bash run.sh
@@ -0,0 +1,27 @@
1
+ # The Dockerfile to build centos with a sudo user
2
+ FROM archlinux:latest
3
+
4
+ # Install the required packages
5
+ RUN pacman -Sy --noconfirm sudo gedit vim git git-lfs curl wget zsh gcc make perl base-devel binutils screen tmux python-pipx p7zip unzip
6
+
7
+ # Create a new user
8
+ RUN useradd -m -s /bin/bash user && \
9
+ usermod -aG wheel user && \
10
+ echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
11
+
12
+ # Set the working directory
13
+ WORKDIR /home/user
14
+ COPY run_user.sh /home/user/run_user.sh
15
+
16
+ # remove the last `zsh` in the script to prevent the endless runtime
17
+ RUN echo "" >> ./run_user.sh
18
+ RUN tac run_user.sh | awk '/^zsh$/ && !found { found = 1; next } 1' | tac > run_user.sh.tmp && mv run_user.sh.tmp run_user.sh
19
+
20
+ # remove the line `systemctl --user start syncthing.service`
21
+ RUN tac run_user.sh | awk '/^systemctl --user start syncthing.service$/ && !found { found = 1; next } 1' | tac > run_user.sh.tmp && mv run_user.sh.tmp run_user.sh
22
+
23
+ # Set the user
24
+ USER user
25
+
26
+ # Set the entrypoint
27
+ CMD bash run_user.sh
@@ -0,0 +1,31 @@
1
+ # The Dockerfile to build centos with a sudo user
2
+ FROM centos:7
3
+
4
+ # Install the required packages
5
+ RUN yum -y update && yum install -y sudo
6
+
7
+ # Create a new user
8
+ RUN useradd -m -s /bin/bash user && \
9
+ usermod -aG wheel user && \
10
+ echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
11
+
12
+ # Set the working directory
13
+ WORKDIR /home/user
14
+ COPY run.sh /home/user/run.sh
15
+
16
+ # remove the last `zsh` in the script to prevent the endless runtime
17
+ RUN echo "" >> ./run.sh
18
+ RUN tac run.sh | awk '/^zsh$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
19
+
20
+ # remove the line `systemctl --user start syncthing.service`
21
+ RUN tac run.sh | awk '/^systemctl --user start syncthing.service$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
22
+
23
+ # remove the line `docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:latest`
24
+ RUN tac run.sh | awk '/^docker run -d -p 9001:9001 --name portainer_agent --restart=always -v \/var\/run\/docker.sock:\/var\/run\/docker.sock -v \/var\/lib\/docker\/volumes:\/var\/lib\/docker\/volumes portainer\/agent:latest$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
25
+
26
+
27
+ # Set the user
28
+ USER user
29
+
30
+ # Set the entrypoint
31
+ CMD bash run.sh
@@ -0,0 +1,27 @@
1
+ # The Dockerfile to build centos with a sudo user
2
+ FROM centos:7
3
+
4
+ # Install the required packages
5
+ RUN yum -y update && yum install -y sudo python3 dnf gedit vim git git-lfs curl wget zsh gcc make perl build-essential screen unzip
6
+
7
+ # Create a new user
8
+ RUN useradd -m -s /bin/bash user && \
9
+ usermod -aG wheel user && \
10
+ echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
11
+
12
+ # Set the working directory
13
+ WORKDIR /home/user
14
+ COPY run_user.sh /home/user/run_user.sh
15
+
16
+ # remove the last `zsh` in the script to prevent the endless runtime
17
+ RUN echo "" >> ./run_user.sh
18
+ RUN tac run_user.sh | awk '/^zsh$/ && !found { found = 1; next } 1' | tac > run_user.sh.tmp && mv run_user.sh.tmp run_user.sh
19
+
20
+ # remove the line `systemctl --user start syncthing.service`
21
+ RUN tac run_user.sh | awk '/^systemctl --user start syncthing.service$/ && !found { found = 1; next } 1' | tac > run_user.sh.tmp && mv run_user.sh.tmp run_user.sh
22
+
23
+ # Set the user
24
+ USER user
25
+
26
+ # Set the entrypoint
27
+ CMD bash run_user.sh
@@ -0,0 +1,30 @@
1
+ # The Dockerfile to build centos with a sudo user
2
+ FROM fedora:39
3
+
4
+ # Install the required packages
5
+ RUN dnf install -y sudo systemd
6
+
7
+ # Create a new user
8
+ RUN useradd -m -s /bin/bash user && \
9
+ usermod -aG wheel user && \
10
+ echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
11
+
12
+ # Set the working directory
13
+ WORKDIR /home/user
14
+ COPY run.sh /home/user/run.sh
15
+
16
+ # remove the last `zsh` in the script to prevent the endless runtime
17
+ RUN echo "" >> ./run.sh
18
+ RUN tac run.sh | awk '/^zsh$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
19
+
20
+ # remove the line `systemctl --user start syncthing.service`
21
+ RUN tac run.sh | awk '/^systemctl --user start syncthing.service$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
22
+
23
+ # remove the line `docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:latest`
24
+ RUN tac run.sh | awk '/^docker run -d -p 9001:9001 --name portainer_agent --restart=always -v \/var\/run\/docker.sock:\/var\/run\/docker.sock -v \/var\/lib\/docker\/volumes:\/var\/lib\/docker\/volumes portainer\/agent:latest$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
25
+
26
+ # Set the user
27
+ USER user
28
+
29
+ # Set the entrypoint
30
+ CMD bash run.sh
@@ -0,0 +1,27 @@
1
+ # The Dockerfile to build centos with a sudo user
2
+ FROM fedora:39
3
+
4
+ # Install the required packages
5
+ RUN dnf install -y sudo python3 gedit vim git git-lfs curl wget zsh gcc make perl screen unzip systemd
6
+
7
+ # Create a new user
8
+ RUN useradd -m -s /bin/bash user && \
9
+ usermod -aG wheel user && \
10
+ echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
11
+
12
+ # Set the working directory
13
+ WORKDIR /home/user
14
+ COPY run_user.sh /home/user/run_user.sh
15
+
16
+ # remove the last `zsh` in the script to prevent the endless runtime
17
+ RUN echo "" >> ./run_user.sh
18
+ RUN tac run_user.sh | awk '/^zsh$/ && !found { found = 1; next } 1' | tac > run_user.sh.tmp && mv run_user.sh.tmp run_user.sh
19
+
20
+ # remove the line `systemctl --user start syncthing.service`
21
+ RUN tac run_user.sh | awk '/^systemctl --user start syncthing.service$/ && !found { found = 1; next } 1' | tac > run_user.sh.tmp && mv run_user.sh.tmp run_user.sh
22
+
23
+ # Set the user
24
+ USER user
25
+
26
+ # Set the entrypoint
27
+ CMD bash run_user.sh
@@ -0,0 +1,30 @@
1
+ # The Dockerfile to build centos with a sudo user
2
+ FROM manjarolinux/base:latest
3
+
4
+ # Install the required packages
5
+ # RUN yum install -y sudo
6
+
7
+ # Create a new user
8
+ RUN useradd -m -s /bin/bash user && \
9
+ usermod -aG wheel user && \
10
+ echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
11
+
12
+ # Set the working directory
13
+ WORKDIR /home/user
14
+ COPY run.sh /home/user/run.sh
15
+
16
+ # remove the last `zsh` in the script to prevent the endless runtime
17
+ RUN echo "" >> ./run.sh
18
+ RUN tac run.sh | awk '/^zsh$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
19
+
20
+ # remove the line `systemctl --user start syncthing.service`
21
+ RUN tac run.sh | awk '/^systemctl --user start syncthing.service$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
22
+
23
+ # remove the line `docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:latest`
24
+ RUN tac run.sh | awk '/^docker run -d -p 9001:9001 --name portainer_agent --restart=always -v \/var\/run\/docker.sock:\/var\/run\/docker.sock -v \/var\/lib\/docker\/volumes:\/var\/lib\/docker\/volumes portainer\/agent:latest$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
25
+
26
+ # Set the user
27
+ USER user
28
+
29
+ # Set the entrypoint
30
+ CMD bash run.sh
@@ -0,0 +1,27 @@
1
+ # The Dockerfile to build centos with a sudo user
2
+ FROM manjarolinux/base:latest
3
+
4
+ # Install the required packages
5
+ RUN pacman -Sy --noconfirm gedit vim git git-lfs curl wget zsh gcc make perl base-devel binutils screen tmux python-pipx p7zip unzip
6
+
7
+ # Create a new user
8
+ RUN useradd -m -s /bin/bash user && \
9
+ usermod -aG wheel user && \
10
+ echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
11
+
12
+ # Set the working directory
13
+ WORKDIR /home/user
14
+ COPY run_user.sh /home/user/run_user.sh
15
+
16
+ # remove the last `zsh` in the script to prevent the endless runtime
17
+ RUN echo "" >> ./run_user.sh
18
+ RUN tac run_user.sh | awk '/^zsh$/ && !found { found = 1; next } 1' | tac > run_user.sh.tmp && mv run_user.sh.tmp run_user.sh
19
+
20
+ # remove the line `systemctl --user start syncthing.service`
21
+ RUN tac run_user.sh | awk '/^systemctl --user start syncthing.service$/ && !found { found = 1; next } 1' | tac > run_user.sh.tmp && mv run_user.sh.tmp run_user.sh
22
+
23
+ # Set the user
24
+ USER user
25
+
26
+ # Set the entrypoint
27
+ CMD bash run_user.sh
@@ -0,0 +1,36 @@
1
+ # The Dockerfile to build ubuntu with a sudo user
2
+ FROM ubuntu:22.04
3
+
4
+ # Set the environment variables
5
+ ARG DEBIAN_FRONTEND=noninteractive
6
+
7
+ # Install the required packages
8
+ RUN apt update
9
+ RUN apt install -y sudo
10
+ RUN echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
11
+ RUN TZ=Etc/UTC apt install -o DPkg::Options::="--force-confnew" -y tzdata
12
+
13
+ # Create a new user
14
+ RUN useradd -m -s /bin/bash user && \
15
+ usermod -aG sudo user && \
16
+ echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
17
+
18
+ # Set the working directory
19
+ WORKDIR /home/user
20
+ COPY run.sh /home/user/run.sh
21
+
22
+ # remove the last `zsh` in the script to prevent the endless runtime
23
+ RUN echo "" >> ./run.sh
24
+ RUN tac run.sh | awk '/^zsh$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
25
+
26
+ # remove the line `systemctl --user start syncthing.service`
27
+ RUN tac run.sh | awk '/^systemctl --user start syncthing.service$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
28
+
29
+ # remove the line `docker run -d -p 9001:9001 --name portainer_agent --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker/volumes:/var/lib/docker/volumes portainer/agent:latest`
30
+ RUN tac run.sh | awk '/^docker run -d -p 9001:9001 --name portainer_agent --restart=always -v \/var\/run\/docker.sock:\/var\/run\/docker.sock -v \/var\/lib\/docker\/volumes:\/var\/lib\/docker\/volumes portainer\/agent:latest$/ && !found { found = 1; next } 1' | tac > run.sh.tmp && mv run.sh.tmp run.sh
31
+
32
+ # Set the user
33
+ USER user
34
+
35
+ # Set the entrypoint
36
+ CMD bash run.sh
@@ -0,0 +1,33 @@
1
+ # The Dockerfile to build ubuntu with a sudo user
2
+ FROM ubuntu:22.04
3
+
4
+ # Set the environment variables
5
+ ARG DEBIAN_FRONTEND=noninteractive
6
+
7
+ # Install the required packages
8
+ RUN apt update
9
+ RUN apt install -y sudo net-tools python3-venv apt-utils make openssh-server gedit vim git git-lfs curl wget zsh gcc make perl build-essential libfuse2 python3-pip
10
+ RUN echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections
11
+ RUN TZ=Etc/UTC apt install -o DPkg::Options::="--force-confnew" -y tzdata
12
+
13
+ # Create a new user
14
+ RUN useradd -m -s /bin/bash user && \
15
+ usermod -aG sudo user && \
16
+ echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
17
+
18
+ # Set the working directory
19
+ WORKDIR /home/user
20
+ COPY run_user.sh /home/user/run_user.sh
21
+
22
+ # remove the last `zsh` in the script to prevent the endless runtime
23
+ RUN echo "" >> ./run_user.sh
24
+ RUN tac run_user.sh | awk '/^zsh$/ && !found { found = 1; next } 1' | tac > run_user.sh.tmp && mv run_user.sh.tmp run_user.sh
25
+
26
+ # remove the line `systemctl --user start syncthing.service`
27
+ RUN tac run_user.sh | awk '/^systemctl --user start syncthing.service$/ && !found { found = 1; next } 1' | tac > run_user.sh.tmp && mv run_user.sh.tmp run_user.sh
28
+
29
+ # Set the user
30
+ USER user
31
+
32
+ # Set the entrypoint
33
+ CMD bash run_user.sh
@@ -0,0 +1,30 @@
1
+ name: Lagacy Test
2
+ on:
3
+ workflow_call:
4
+ pull_request:
5
+ paths-ignore:
6
+ - "**"
7
+ - "!run.sh"
8
+ - "!run_user.sh"
9
+
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-latest
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os: [ubuntu, fedora, manjaro, arch]
17
+ mode: [sudo, user]
18
+ name: ${{ matrix.os }} ${{ matrix.mode }} test
19
+
20
+ steps:
21
+ - name: Checkout
22
+ uses: actions/checkout@v4
23
+ with:
24
+ fetch-depth: 0
25
+
26
+ - name: Build docker image
27
+ run: docker build -f .github/integration-test/Dockerfile-${{ matrix.os }}-${{ matrix.mode }} -t test_os .
28
+
29
+ - name: Run docker container
30
+ run: docker run --rm --privileged=true test_os
@@ -0,0 +1,150 @@
1
+ name: Release to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*' # Triggers on version tags like v1.0.0, v2.1.3, etc.
7
+ branches:
8
+ - main
9
+ workflow_dispatch:
10
+ inputs:
11
+ test_pypi:
12
+ description: 'Upload to Test PyPI instead of PyPI'
13
+ required: false
14
+ default: false
15
+ type: boolean
16
+
17
+ jobs:
18
+ test:
19
+ uses: ./.github/workflows/test.yaml
20
+
21
+ lagacy-test:
22
+ uses: ./.github/workflows/lagacy_test.yaml
23
+
24
+ build-python:
25
+ needs: test
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+
30
+ - uses: prefix-dev/setup-pixi@v0.8.3
31
+ with:
32
+ pixi-version: v0.47.0
33
+ cache: true
34
+ manifest-path: pyproject.toml
35
+
36
+ - name: Fetch all tags for setuptools_scm
37
+ run: git fetch --prune --unshallow --tags
38
+
39
+ - name: Build Python package
40
+ run: pixi run build-package
41
+
42
+ - name: Upload Python package artifacts
43
+ uses: actions/upload-artifact@v4
44
+ with:
45
+ name: python-dist
46
+ path: dist/
47
+
48
+ build-executable:
49
+ needs: test
50
+ runs-on: ubuntu-latest
51
+ steps:
52
+ - uses: actions/checkout@v4
53
+
54
+ - uses: prefix-dev/setup-pixi@v0.8.3
55
+ with:
56
+ pixi-version: v0.47.0
57
+ cache: true
58
+ manifest-path: pyproject.toml
59
+
60
+ - name: Build standalone executable
61
+ run: pixi run build-prod
62
+
63
+ - name: List built files
64
+ run: ls -la dist/
65
+
66
+ - name: Upload executable artifact
67
+ uses: actions/upload-artifact@v4
68
+ with:
69
+ name: executable
70
+ path: dist/envira
71
+
72
+ publish:
73
+ # skip if pushed from main branch, only trigger on tag push and workflow_dispatch
74
+ if: github.event_name != 'push' || github.ref != 'refs/heads/main'
75
+ needs: build-python
76
+ runs-on: ubuntu-latest
77
+ environment:
78
+ name: ${{ github.event.inputs.test_pypi == 'true' && 'testpypi' || 'pypi' }}
79
+ url: ${{ github.event.inputs.test_pypi == 'true' && 'https://test.pypi.org/p/envira' || 'https://pypi.org/p/envira' }}
80
+ permissions:
81
+ id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
82
+ steps:
83
+ - name: Download Python package artifacts
84
+ uses: actions/download-artifact@v4
85
+ with:
86
+ name: python-dist
87
+ path: dist/
88
+
89
+ - name: Publish to Test PyPI
90
+ if: github.event.inputs.test_pypi == 'true'
91
+ uses: pypa/gh-action-pypi-publish@release/v1
92
+ with:
93
+ repository-url: https://test.pypi.org/legacy/
94
+ verbose: true
95
+
96
+ - name: Publish to PyPI
97
+ if: github.event.inputs.test_pypi != 'true'
98
+ uses: pypa/gh-action-pypi-publish@release/v1
99
+ with:
100
+ verbose: true
101
+
102
+ release-web:
103
+ needs: build-executable
104
+ uses: ./.github/workflows/release_web.yaml
105
+ secrets:
106
+ DEPLOY_PRIVATE: ${{ secrets.DEPLOY_PRIVATE }}
107
+
108
+ release:
109
+ needs: [build-executable, publish]
110
+ runs-on: ubuntu-latest
111
+ if: github.event.inputs.test_pypi != 'true'
112
+ permissions:
113
+ contents: write # IMPORTANT: this permission is mandatory for creating releases
114
+ steps:
115
+ - uses: actions/checkout@v4
116
+
117
+ - name: Download executable artifact
118
+ uses: actions/download-artifact@v4
119
+ with:
120
+ name: executable
121
+ path: ./
122
+
123
+ - name: Get tag name
124
+ id: tag
125
+ run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
126
+
127
+ - name: Create GitHub Release
128
+ uses: softprops/action-gh-release@v2
129
+ with:
130
+ tag_name: ${{ steps.tag.outputs.TAG_NAME }}
131
+ name: Release ${{ steps.tag.outputs.TAG_NAME }}
132
+ draft: false
133
+ prerelease: false
134
+ files: ./envira
135
+ body: |
136
+ ## [${{ steps.tag.outputs.TAG_NAME }}] Envira Release
137
+ ```
138
+
139
+ verify:
140
+ needs: publish
141
+ runs-on: ubuntu-latest
142
+ if: github.event.inputs.test_pypi != 'true'
143
+ steps:
144
+ - name: Wait for PyPI to update
145
+ run: sleep 60
146
+
147
+ - name: Verify installation from PyPI
148
+ run: |
149
+ pip install envira
150
+ python -c "import envira; print('Package installed successfully')"
@@ -0,0 +1,56 @@
1
+ name: Release Web
2
+
3
+ on:
4
+ workflow_call:
5
+ secrets:
6
+ DEPLOY_PRIVATE:
7
+ required: true
8
+
9
+ jobs:
10
+ release-web:
11
+
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Prepare folder
18
+ run: |
19
+ mkdir -p ~/dist
20
+ mkdir -p ~/dist/user
21
+ mkdir -p ~/dist/envira
22
+ mv files ~/dist/files
23
+
24
+ - name: Download executable artifact
25
+ uses: actions/download-artifact@v4
26
+ with:
27
+ name: executable
28
+ path: ~/dist/files
29
+
30
+ - name: Clean files
31
+ run: |
32
+ mv run.sh ~/dist/index.html
33
+ mv run_user.sh ~/dist/user/index.html
34
+ mv envira.sh ~/dist/envira/index.html
35
+ echo "boot.controlnet.space" > ~/dist/CNAME
36
+
37
+ - name: Init git and commit
38
+ env:
39
+ DEPLOY_PRIVATE: ${{ secrets.DEPLOY_PRIVATE }}
40
+ run: |
41
+ mkdir -p ~/.ssh/
42
+ echo "$DEPLOY_PRIVATE" > ~/.ssh/id_rsa
43
+ chmod 600 ~/.ssh/id_rsa
44
+ ssh-keyscan github.com >> ~/.ssh/known_hosts
45
+ git config --global user.email "smczx@hotmail.com"
46
+ git config --global user.name "ControlNet"
47
+ cd ~/dist
48
+ git init
49
+ git add -A
50
+ git commit -m "update"
51
+ git remote add origin-ssh git@github.com:ControlNet/envira.git
52
+
53
+ - name: Push
54
+ run: |
55
+ git push origin-ssh HEAD:dist -f
56
+ working-directory: /home/runner/dist/
@@ -0,0 +1,23 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches-ignore:
6
+ - main
7
+ pull_request:
8
+ workflow_call:
9
+
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - uses: prefix-dev/setup-pixi@v0.8.3
17
+ with:
18
+ pixi-version: v0.47.0
19
+ cache: true
20
+ manifest-path: pyproject.toml
21
+
22
+ - name: Run tests
23
+ run: pixi run test