Merge pull request #64 from ITCraftDevelopmentTeam/dependabot/github_… #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'Build (Dev)' | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| build-windows: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [windows-latest] | |
| arch: [x86, x64, arm64] | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v5 | |
| - name: "Setup Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - name: Setup Poetry | |
| uses: snok/install-poetry@v1.4.1 | |
| - name: "Install requirements and build" | |
| shell: bash | |
| run: | | |
| poetry install --all-groups | |
| poetry run nuitka \ | |
| --standalone\ | |
| --onefile\ | |
| --follow-imports\ | |
| --output-dir=build\ | |
| --lto=yes\ | |
| --windows-icon-from-ico=icon.ico\ | |
| --enable-console\ | |
| main.py | |
| - name: "Rename application" | |
| run: | | |
| Move-Item -Path .\build\main.exe -Destination .\build\onedisc.exe | |
| - name: "Upload build" | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: OneDisc ${{ needs.get-version-number.outputs.VERSION }} for ${{ matrix.os }}-${{ matrix.arch }} | |
| path: build/onedisc.exe | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04, macos-latest] | |
| arch: [x86, x64, arm64] | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v5 | |
| - name: "Setup Python" | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - name: Setup Poetry | |
| uses: snok/install-poetry@v1.4.1 | |
| - name: "Install requirements and build" | |
| run: | | |
| poetry install --all-groups | |
| poetry run nuitka --standalone\ | |
| --onefile\ | |
| --follow-imports\ | |
| --show-modules\ | |
| --macos-app-icon=icon.ico\ | |
| --output-dir=build\ | |
| --lto=yes\ | |
| main.py | |
| - name: "Rename application" | |
| run: | | |
| mv build/main.bin build/onedisc | |
| - name: "Upload build" | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: OneDisc ${{ needs.get-version-number.outputs.VERSION }} for ${{ matrix.os }}-${{ matrix.arch }} | |
| path: build/onedisc | |
| get-version-number: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: "Get version number" | |
| id: get_version | |
| run: | | |
| export VERSION=$(python -c 'print(__import__("version").VERSION)') | |
| export SUB_VER=$(git rev-list --no-merges --count $(git describe --tags --abbrev=0)..HEAD) | |
| echo "Currect Version Number: $VERSION.$SUB_VER" | |
| echo "SUB_VER = $SUB_VER" >> version.py | |
| # Create an environment file | |
| echo "VERSION=${VERSION}.${SUB_VER}" >> $GITHUB_OUTPUT | |
| echo "SUB_VERSION=${SUB_VER}" >> $GITHUB_OUTPUT | |
| outputs: | |
| VERSION: ${{ steps.get_version.outputs.VERSION }} | |
| SUB_VERSION: ${{ steps.get_version.outputs.SUB_VERSION }} | |
| deloy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v5 | |
| - name: "Set up Node.js" | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '21' | |
| registry-url: 'https://registry.npmjs.org/' | |
| - name: Install requirements | |
| run: | | |
| npm install | |
| - name: Build Documents | |
| run: | | |
| npm run docs:build | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./docs/.vitepress/dist/ |