-
Notifications
You must be signed in to change notification settings - Fork 1
Fixed Publishing, made it a Rolling Release #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ed23209
8f5c9fa
b266a9e
b5a0a9a
0ce2341
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,135 @@ | ||
| name: Manual Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| release_tag: | ||
| description: "Release tag (e.g., v1.2.3)" | ||
| required: true | ||
| type: string | ||
| release_name: | ||
| description: "Release title" | ||
| required: true | ||
| type: string | ||
| release_notes: | ||
| description: "Release notes (optional; leave blank to auto-generate)" | ||
| required: false | ||
| type: string | ||
| prerelease: | ||
| description: "Mark this release as a prerelease" | ||
| required: true | ||
| type: boolean | ||
| default: false | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Test (unittest + pytest) | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.ref }} | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: python | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements-build.txt | ||
| pip install pytest | ||
|
|
||
| - name: Run unit tests | ||
| working-directory: python | ||
| run: python -m unittest discover -s tests -v | ||
|
|
||
| - name: Run pytest | ||
| working-directory: python | ||
| run: pytest tests/ -v | ||
|
|
||
| build-windows-x64: | ||
| name: Build (windows-x64) | ||
| needs: test | ||
| runs-on: windows-latest | ||
| timeout-minutes: 30 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.ref }} | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install build dependencies | ||
| working-directory: python | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install -r requirements-build.txt | ||
|
|
||
| - name: Run parity smoke test | ||
| working-directory: python | ||
| run: | | ||
| python -m unittest tests.test_fca_unittest.TestFCAToolParity.test_tool_encode_decode_matches_standalone -v | ||
|
|
||
| - name: Ensure icon file exists | ||
| working-directory: python | ||
| run: | | ||
| if (!(Test-Path small-logo.ico)) { | ||
| python build_icon.py --input-file small-logo.png --output-file small-logo.ico | ||
| } | ||
|
|
||
| - name: Build executables | ||
| working-directory: python | ||
| run: | | ||
| python -m PyInstaller --clean --noconfirm --onefile --icon small-logo.ico --name fca-encode --distpath ../dist/windows-x64 fca_encode.py | ||
| python -m PyInstaller --clean --noconfirm --onefile --icon small-logo.ico --name fca-decode --distpath ../dist/windows-x64 fca_decode.py | ||
| python -m PyInstaller --clean --noconfirm --onefile --icon small-logo.ico --name fca-tool --distpath ../dist/windows-x64 fca_tool.py | ||
|
|
||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: fca-exes-windows-x64 | ||
| path: dist/windows-x64 | ||
| if-no-files-found: error | ||
|
|
||
| release: | ||
| name: Publish Release | ||
| needs: build-windows-x64 | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Download windows-x64 artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: fca-exes-windows-x64 | ||
| path: dist/windows-x64 | ||
|
|
||
| - name: Create release and upload assets | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ inputs.release_tag }} | ||
| name: ${{ inputs.release_name }} | ||
| target_commitish: ${{ github.sha }} | ||
| body: ${{ inputs.release_notes }} | ||
| generate_release_notes: ${{ inputs.release_notes == '' }} | ||
| files: dist/windows-x64/* | ||
| overwrite_files: true | ||
| make_latest: true | ||
|
||
| prerelease: ${{ inputs.prerelease }} | ||
| fail_on_unmatched_files: true | ||
| # Placeholder for custom changelog input: | ||
| # append_body: true | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The github.event.head_commit.message may be null or unavailable in certain workflow trigger contexts (such as workflow_dispatch or when pushing multiple commits). This could result in an incomplete or missing commit message in the release body. Consider adding a fallback or checking if head_commit exists before accessing its message property.