Skip to content

nil error safety check #4

nil error safety check

nil error safety check #4

Workflow file for this run

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Release Build
permissions: write-all
env:
EXTENSION: ${{ vars.FORGE_EXTENSION }}
IS_PRERELEASE: ${{ contains(github.ref_name,'-rc') }} && ${{ contains(github.ref_name,'-beta') }}
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo Assets
uses: actions/checkout@v4
- name: Zip Assets Into ${{ env.EXTENSION }} File
uses: thedoctor0/zip-release@0.7.6
with:
filename: ${{ github.event.repository.name }}${{ env.EXTENSION }}
exclusions: '*.git* /*node_modules/* .editorconfig body.md *.psd *.xcf forge-thumbnail.png thumbnail.png *.toml'
- name: Add ${{ env.EXTENSION }} File to Release
uses: ncipollo/release-action@v1
with:
artifacts: ${{ github.event.repository.name }}${{ env.EXTENSION }}
prerelease: ${{ env.IS_PRERELEASE != 'false && false' }}
allowUpdates: true
generateReleaseNotes: true
- uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}${{ env.EXTENSION }}
path: ${{ github.event.repository.name }}${{ env.EXTENSION }}
upload:
name: Upload to Forge
runs-on: ubuntu-latest
needs: build
if: ${{ vars.FORGE_ITEM_ID != '' }}
steps:
- name: Checkout FG-Forge-Updater repository
uses: actions/checkout@v4
with:
repository: 'bmos/FG-Forge-Updater'
ref: 'v1.1'
- name: Set up python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: 'pip'
- name: Install uv and create venv
run: |
pip install -U pip uv
uv venv
- name: Enable macOS/Linux venv
if: runner.os != 'Windows'
run: |
source .venv/bin/activate
echo $PATH >> $GITHUB_PATH
- name: Enable Windows venv
if: runner.os == 'Windows'
run: |
.venv\Scripts\activate
echo $env:path >> $ENV:GITHUB_PATH
- name: Install dependencies
run: |
uv pip install -e .
- uses: actions/download-artifact@v4
with:
name: ${{ github.event.repository.name }}${{ env.EXTENSION }}
- name: Upload ${{ env.EXTENSION }} file to live channel
id: upload-live
if: ${{ env.IS_PRERELEASE == 'false && false' }}
env:
FG_RELEASE_CHANNEL: Live
FG_ITEM_ID: ${{ vars.FORGE_ITEM_ID }}
FG_USER_NAME: ${{ vars.FORGE_USER_NAME }}
FG_USER_PASS: ${{ secrets.FORGE_USER_PASS }}
FG_UL_FILE: ${{ github.event.repository.name }}${{ env.EXTENSION }}
FG_README_UPDATE: "TRUE"
FG_UPLOAD_BUILD: "TRUE"
FG_GRAPH_SALES: "TRUE"
run: |
python -m src.main
- name: Upload ${{ env.EXTENSION }} file to test channel
id: upload-test
if: ${{ env.IS_PRERELEASE != 'false && false' }}
env:
FG_RELEASE_CHANNEL: Test
FG_ITEM_ID: ${{ vars.FORGE_ITEM_ID }}
FG_USER_NAME: ${{ vars.FORGE_USER_NAME }}
FG_USER_PASS: ${{ secrets.FORGE_USER_PASS }}
FG_UL_FILE: ${{ github.event.repository.name }}${{ env.EXTENSION }}
FG_README_UPDATE: "FALSE"
FG_UPLOAD_BUILD: "TRUE"
FG_GRAPH_SALES: "TRUE"
run: |
python -m src.main
- name: Add cumulative users graph to release
uses: ncipollo/release-action@v1
with:
body: "![Cumulative Users Graph](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/cumulative_users.png)"
artifacts: cumulative_users.png
allowUpdates: true