Skip to content

Deploying the installer... #12

Deploying the installer...

Deploying the installer... #12

name: deploy-installer
run-name: Deploying the installer...
on: [workflow_dispatch]
jobs:
release:
name: Creating a release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v2
- name: Get last release info
uses: cardinalby/git-get-release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseNameRegEx: "PissMC Installer I*"
doNotFailIfNotFound: true
id: release_info
- name: Get new tally mark amount
env:
OLDNAME: ${{ steps.release_info.outputs.name }}
run: echo "::set-output name=fragment::${OLDNAME##* }I"
id: split
- name: Create new release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "i(${{ steps.split.outputs.fragment }})"
release_name: "PissMC Installer ${{ steps.split.outputs.fragment }}"
body: "Release"
id: create_release
build:
name: Building the installer
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
needs: release
steps:
- uses: actions/checkout@v2
- uses: kenchan0130/actions-system-info@master
id: system-info
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install deps and build the installer
run: |
cd installer
pip install -r requirements.txt pyinstaller
pyinstaller pissmc-installer.spec
echo "FILE=pissmc-installer${{ steps.system-info.outputs.platform == 'win32' && '.exe' || '' }}" >> $GITHUB_ENV
- name: Upload assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: "installer/dist/${{ env.FILE }}"
asset_name: ${{ steps.system-info.outputs.platform }}-${{ env.FILE }}
asset_content_type: ${{ steps.system-info.outputs.platform == 'win32' && 'application/x-msdownload' || 'application/x-elf' }}