redfetch 0.2.1.dev0__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.
@@ -0,0 +1,198 @@
1
+ # This workflow will upload a Python Package using Twine when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Publish
10
+
11
+ on:
12
+ push:
13
+ branches:
14
+ - 'develop'
15
+ tags:
16
+ - 'v*.*.*'
17
+ workflow_dispatch:
18
+
19
+ permissions:
20
+ contents: read
21
+ id-token: write # Required for PyPI Trusted Publishing
22
+
23
+ jobs:
24
+ build-and-publish-python:
25
+ runs-on: ubuntu-latest
26
+ outputs:
27
+ package-version: ${{ steps.get_version.outputs.version }}
28
+ steps:
29
+ - name: Checkout Code
30
+ uses: actions/checkout@v4
31
+ with:
32
+ fetch-depth: 0 # Ensure full Git history is available for versioning
33
+
34
+ - name: Set Up Python
35
+ uses: actions/setup-python@v5
36
+ with:
37
+ python-version: '3.x'
38
+
39
+ - name: Set Environment Variables
40
+ run: |
41
+ if [ "${{ github.ref }}" == "refs/heads/develop" ]; then
42
+ echo "REDFETCH_BASE_URL=https://www.redguides.com/devtestbaby" >> $GITHUB_ENV
43
+ fi
44
+
45
+ - name: Install Hatch
46
+ uses: pypa/hatch@install
47
+
48
+ - name: Run Tests
49
+ run: |
50
+ hatch test
51
+
52
+ - name: Build Package
53
+ run: |
54
+ hatch build
55
+
56
+ - name: Get Version
57
+ id: get_version
58
+ run: echo "version=$(hatch version)" >> $GITHUB_OUTPUT
59
+
60
+ - name: Publish to TestPyPI
61
+ if: github.ref == 'refs/heads/develop'
62
+ uses: pypa/gh-action-pypi-publish@release/v1
63
+ with:
64
+ repository-url: https://test.pypi.org/legacy/
65
+
66
+ - name: Publish to PyPI
67
+ if: startsWith(github.ref, 'refs/tags/v')
68
+ uses: pypa/gh-action-pypi-publish@release/v1
69
+
70
+ build-and-publish-exe:
71
+ needs: build-and-publish-python
72
+ if: needs.build-and-publish-python.result == 'success'
73
+ runs-on: windows-latest
74
+
75
+ steps:
76
+ - name: Checkout Code
77
+ uses: actions/checkout@v4
78
+ with:
79
+ fetch-depth: 0 # Ensure full Git history is available for versioning
80
+
81
+ - name: Set Environment Variables
82
+ id: set_env_vars
83
+ shell: pwsh
84
+ run: |
85
+ # Set static environment variables
86
+ "PYAPP_PROJECT_NAME=redfetch" >> $env:GITHUB_ENV
87
+ "PYAPP_EXEC_MODULE=redfetch.main" >> $env:GITHUB_ENV
88
+ "PYAPP_PASS_LOCATION=1" >> $env:GITHUB_ENV
89
+
90
+ # Conditionally set PYAPP_PIP_EXTRA_ARGS based on the branch or tag
91
+ if ($env:GITHUB_REF -eq 'refs/heads/develop') {
92
+ $pipArgs = "--index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/"
93
+ } else {
94
+ $pipArgs = ""
95
+ }
96
+ "PYAPP_PIP_EXTRA_ARGS=$pipArgs" >> $env:GITHUB_ENV
97
+
98
+ # Output the values for verification
99
+ Get-Content $env:GITHUB_ENV
100
+
101
+ - name: Set Up Python
102
+ uses: actions/setup-python@v5
103
+ with:
104
+ python-version: '3.x'
105
+
106
+ - name: Install Hatch
107
+ run: pip install hatch
108
+
109
+ - name: Set PYAPP_PROJECT_VERSION
110
+ run: |
111
+ "PYAPP_PROJECT_VERSION=${{ needs.build-and-publish-python.outputs.package-version }}" >> $env:GITHUB_ENV
112
+ shell: pwsh
113
+
114
+ - name: Set Up Rust
115
+ uses: dtolnay/rust-toolchain@stable
116
+ with:
117
+ toolchain: stable
118
+ components: rustfmt, clippy
119
+
120
+ - name: Install 7-Zip
121
+ run: choco install 7zip --no-progress -y
122
+
123
+ - name: Download PyApp Source
124
+ shell: pwsh
125
+ run: |
126
+ Invoke-WebRequest https://github.com/ofek/pyapp/releases/latest/download/source.zip -OutFile pyapp-source.zip
127
+ 7z x pyapp-source.zip -o"./pyapp-source"
128
+ $dir = Get-ChildItem -Path .\pyapp-source\ -Directory | Select-Object -First 1
129
+ Move-Item -Path $dir.FullName -Destination pyapp-latest
130
+
131
+ - name: Build PyApp Executable
132
+ run: |
133
+ $env:PYAPP_PROJECT_NAME = "${{ env.PYAPP_PROJECT_NAME }}"
134
+ $env:PYAPP_EXEC_MODULE = "${{ env.PYAPP_EXEC_MODULE }}"
135
+ $env:PYAPP_PASS_LOCATION = "${{ env.PYAPP_PASS_LOCATION }}"
136
+ $env:PYAPP_PIP_EXTRA_ARGS = "${{ env.PYAPP_PIP_EXTRA_ARGS }}"
137
+ $env:PYAPP_PROJECT_VERSION = "${{ env.PYAPP_PROJECT_VERSION }}"
138
+
139
+ Write-Host "PYAPP_PROJECT_NAME: $env:PYAPP_PROJECT_NAME"
140
+ Write-Host "PYAPP_EXEC_MODULE: $env:PYAPP_EXEC_MODULE"
141
+ Write-Host "PYAPP_PASS_LOCATION: $env:PYAPP_PASS_LOCATION"
142
+ Write-Host "PYAPP_PIP_EXTRA_ARGS: $env:PYAPP_PIP_EXTRA_ARGS"
143
+ Write-Host "PYAPP_PROJECT_VERSION: $env:PYAPP_PROJECT_VERSION"
144
+
145
+ cargo build --release
146
+ working-directory: .\pyapp-latest
147
+ shell: pwsh
148
+
149
+ - name: Rename and Move Executable
150
+ shell: pwsh
151
+ run: |
152
+ Move-Item .\pyapp-latest\target\release\pyapp.exe redfetch.exe
153
+
154
+ - name: Download rcedit
155
+ shell: pwsh
156
+ run: |
157
+ Invoke-WebRequest https://github.com/electron/rcedit/releases/latest/download/rcedit-x64.exe -OutFile rcedit.exe
158
+
159
+ - name: Modify Executable Properties
160
+ shell: pwsh
161
+ run: |
162
+ .\rcedit.exe redfetch.exe `
163
+ --set-version-string "ProductName" "RedFetch" `
164
+ --set-version-string "FileDescription" "Download and publish EverQuest scripts and software using the RedGuides API" `
165
+ --set-file-version "${{ env.PYAPP_PROJECT_VERSION }}" `
166
+ --set-product-version "${{ env.PYAPP_PROJECT_VERSION }}" `
167
+ --set-version-string "LegalCopyright" "© RedGuides, LLC" `
168
+ --set-version-string "OriginalFilename" "redfetch.exe" `
169
+ --set-version-string "InternalName" "redfetch" `
170
+ --set-icon "redfetch.ico"
171
+
172
+ - name: Sign Executable
173
+ uses: dlemstra/code-sign-action@v1
174
+ with:
175
+ certificate: '${{ secrets.CERTIFICATE_PFX }}'
176
+ password: '${{ secrets.CERTIFICATE_PFX_PASSWORD }}'
177
+ files: |
178
+ redfetch.exe
179
+ description: 'RedFetch Executable'
180
+
181
+ - name: Redguides Publish
182
+ if: startsWith(github.ref, 'refs/tags/v')
183
+ uses: RedGuides/redguides-publish@v1
184
+ env:
185
+ REDGUIDES_API_KEY: ${{ secrets.REDGUIDES_API_KEY }}
186
+ with:
187
+ resource_id: '3177'
188
+ description: 'README.md'
189
+ version: ${{ env.PYAPP_PROJECT_VERSION }}
190
+ message: 'CHANGELOG.md'
191
+ file: 'redfetch.exe'
192
+ domain: 'https://raw.githubusercontent.com/RedGuides/redfetch/main/'
193
+
194
+ - name: Upload Executable Artifact
195
+ uses: actions/upload-artifact@v4
196
+ with:
197
+ name: redfetch.exe
198
+ path: redfetch.exe
@@ -0,0 +1,43 @@
1
+ # Python cache files
2
+ __pycache__/
3
+ .pytest_cache/
4
+ *.pyc
5
+ *.pyo
6
+
7
+ #virtual environments
8
+ env/
9
+ venv/
10
+
11
+ # Downloaded files
12
+ Downloads/
13
+
14
+ # Build files
15
+ build/
16
+ dist/
17
+
18
+ # Secret configuration
19
+ .secrets.toml
20
+ # Local configuration
21
+ *.local.toml
22
+
23
+ # Database files
24
+ *.db
25
+
26
+ # Environment file
27
+ .env
28
+
29
+ # Editor-specific files
30
+ .vscode/
31
+ .idea/
32
+ .cursorignore
33
+
34
+ # Operating system files
35
+ .DS_Store
36
+ Thumbs.db
37
+
38
+ # Other cruft
39
+ *.bak
40
+ *.swp
41
+ *.backup
42
+ *.egg-info
43
+ .github/workflows/samplepypi.yml
@@ -0,0 +1,11 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.0] - 2024-10-27
9
+
10
+ ### Added
11
+ - Initial release of the project