Skip to content

dev_releases

dev_releases #180

Workflow file for this run

name: dev_releases
on:
schedule:
- cron: '0 19 * * *'
workflow_dispatch:
jobs:
setup_ubuntu_x86_64:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: 'refs/heads/dev'
- name: Setup Python (x64)
uses: actions/setup-python@v5
with:
python-version: 3.x
architecture: "x64"
- name: Install Hatch
run: pip install hatch
- name: Create Hatch virtual environment for x86_64-linux
run: hatch env create x86_64-unknown-linux-gnu
- name: Build Release
run: hatch run py_project_dev_tools make_exe_release_ci_cd --os_arch_line "x86_64-unknown-linux-gnu"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ue4ss_installer_gui_x86_64-unknown-linux-gnu
path: dist/ue4ss_installer_gui_x86_64-unknown-linux-gnu.zip
setup_windows_x86_64:
if: github.ref == 'refs/heads/main'
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: 'refs/heads/dev'
- name: Setup Python (x64)
uses: actions/setup-python@v5
with:
python-version: 3.x
architecture: "x64"
- name: Install Hatch
run: pip install hatch
- name: Create Hatch virtual environment for x86_64-windows
run: hatch env create x86_64-pc-windows-msvc
- name: Build Release
run: hatch run py_project_dev_tools make_exe_release_ci_cd --os_arch_line "x86_64-pc-windows-msvc"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ue4ss_installer_gui_x86_64-pc-windows-msvc
path: dist/ue4ss_installer_gui_x86_64-pc-windows-msvc.zip
bump_version:
runs-on: ubuntu-latest
needs: [setup_ubuntu_x86_64, setup_windows_x86_64]
steps:
- name: Check out
uses: actions/checkout@v4
with:
token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"
fetch-depth: 0
ref: 'refs/heads/dev'
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
changelog_increment_filename: body.md
devrelease: ${{ github.run_id }}
- name: Create version.txt
run: |
echo "Revision: ${{ env.REVISION }}" > version.txt
- name: Upload version.txt
uses: actions/upload-artifact@v4
with:
name: version.txt
path: version.txt
- name: Upload changelog body.md
uses: actions/upload-artifact@v4
with:
name: body.md
path: body.md
setup_github_releases:
runs-on: ubuntu-latest
needs: [bump_version]
steps:
- name: Download ubuntu_x86_64_artifact
uses: actions/download-artifact@v4
with:
name: ue4ss_installer_gui_x86_64-unknown-linux-gnu
path: ./dist
- name: Download windows_x86_64_artifact
uses: actions/download-artifact@v4
with:
name: ue4ss_installer_gui_x86_64-pc-windows-msvc
path: ./dist
- name: Download version.txt artifact
uses: actions/download-artifact@v4
with:
name: version.txt
- name: Read version from version.txt
id: extract_version
run: |
# Read the contents of the downloaded version.txt file and extract the revision
VERSION=$(cat version.txt | grep -oP 'Revision: \K.*') # Extract the version number after "Revision: "
echo "Version extracted: $VERSION"
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
- name: Rename artifacts with version suffix
run: |
VERSION="${{ steps.extract_version.outputs.version }}"
cd dist
for FILE in ue4ss_installer_gui*.zip; do
if [[ "$FILE" != *"$VERSION"* ]]; then
BASE="${FILE%.zip}"
# Replace underscores with hyphens and add version
NEW_NAME=$(echo "$BASE" | sed 's/_/-/g')-"$VERSION".zip
mv "$FILE" "$NEW_NAME"
fi
done
- name: Generate SHA256 hashes for each file
run: |
cd dist
# For each file in dist, generate its SHA256 hash and create a .sha256 file
for FILE in *; do
if [[ -f "$FILE" ]]; then
# Generate SHA256 hash and save it to a .sha256 file
sha256sum "$FILE" | awk '{print $1}' > "$FILE.sha256"
fi
done
- name: List files in dist
run: ls -R dist
- name: Download body.md artifact
uses: actions/download-artifact@v4
with:
name: body.md
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: "body.md"
tag_name: ${{ steps.extract_version.outputs.version }}
files: |
dist/*.zip
dist/*.sha256
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}