Merge pull request #6 from TheEnderek0/dev #16
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: Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| name: Create Release | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - run: git fetch --tags origin | |
| - name: Get previous tag | |
| id: previoustag | |
| uses: 'WyriHaximus/github-action-get-previous-tag@v1' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Next Monotonic Release version | |
| id: next | |
| uses: WyriHaximus/github-action-next-release-version@08a7476c98e8095fad1cce0e2344c7892e17d111 | |
| with: | |
| version: ${{ steps.previoustag.outputs.tag }} | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| if: ${{ github.event.inputs.version == '' }} | |
| with: | |
| tag_name: ${{ steps.next.outputs.version }} | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: $${{ matrix.os }} | |
| name: Build | |
| needs: create-release | |
| if: ${{ always() && !cancelled() && needs.create-release.result == 'success' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12.10' | |
| cache: 'pip' | |
| cache-dependency-path: 'requirements.txt' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install -r requirements.txt | |
| - name: Build executables | |
| run: | | |
| chmod +x ./build.sh | |
| $python_executable=python ./build.sh | |
| shell: bash | |
| # - name: Pack files | |
| # uses: TheDoctor0/[email protected] | |
| # with: | |
| # filename: Release-Win64.zip | |
| # path: ./dist/ | |
| - run: git fetch --tags origin | |
| - name: Get previous tag | |
| id: previoustag | |
| uses: 'WyriHaximus/github-action-get-previous-tag@v1' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload to release | |
| uses: softprops/action-gh-release@v2 | |
| if: ${{ github.event.inputs.version == '' }} | |
| with: | |
| tag_name: ${{ steps.previoustag.outputs.tag }} | |
| files: ./dist/* | |
| fail_on_unmatched_files: true |