|
| 1 | +name: Release |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - psc |
| 6 | + |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + create-release: |
| 11 | + |
| 12 | + runs-on: ubuntu-latest |
| 13 | + name: Create Release |
| 14 | + steps: |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - run: git fetch --tags origin |
| 19 | + |
| 20 | + - name: Get previous tag |
| 21 | + id: previoustag |
| 22 | + uses: 'WyriHaximus/github-action-get-previous-tag@v1' |
| 23 | + env: |
| 24 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 25 | + |
| 26 | + - name: Next Monotonic Release version |
| 27 | + id: next |
| 28 | + uses: WyriHaximus/github-action-next-release-version@08a7476c98e8095fad1cce0e2344c7892e17d111 |
| 29 | + with: |
| 30 | + version: ${{ steps.previoustag.outputs.tag }} |
| 31 | + |
| 32 | + - name: Create Release |
| 33 | + uses: softprops/action-gh-release@v1 |
| 34 | + if: ${{ github.event.inputs.version == '' }} |
| 35 | + with: |
| 36 | + tag_name: ${{ steps.next.outputs.version }} |
| 37 | + |
| 38 | + |
| 39 | + build-fgd: |
| 40 | + runs-on: ubuntu-latest |
| 41 | + needs: create-release |
| 42 | + if: ${{ always() && !cancelled() && needs.create-release.result == 'success' }} |
| 43 | + steps: |
| 44 | + - name: Checkout |
| 45 | + uses: actions/checkout@v4 |
| 46 | + |
| 47 | + - name: Setup Python |
| 48 | + uses: actions/setup-python@v5 |
| 49 | + with: |
| 50 | + python-version: '3.13' |
| 51 | + cache: 'pip' |
| 52 | + cache-dependency-path: 'requirements.txt' |
| 53 | + |
| 54 | + - name: Install dependencies |
| 55 | + run: | |
| 56 | + python -m pip install -r requirements.txt |
| 57 | + |
| 58 | + - name: Build FGD patch |
| 59 | + run: python ./src/hammeraddons/unify_fgd.py -d ./fgd export_pcp -o patch.fgd P2CE |
| 60 | + |
| 61 | + - run: git fetch --tags origin |
| 62 | + |
| 63 | + - name: Get previous tag |
| 64 | + id: previoustag |
| 65 | + uses: 'WyriHaximus/github-action-get-previous-tag@v1' |
| 66 | + env: |
| 67 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 68 | + |
| 69 | + - name: Upload to release |
| 70 | + uses: softprops/action-gh-release@v1 |
| 71 | + if: ${{ github.event.inputs.version == '' }} |
| 72 | + with: |
| 73 | + tag_name: ${{ steps.previoustag.outputs.tag }} |
| 74 | + files: patch.fgd |
| 75 | + fail_on_unmatched_files: true |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + build: |
| 80 | + strategy: |
| 81 | + matrix: |
| 82 | + os: [ubuntu-latest, windows-latest] |
| 83 | + |
| 84 | + runs-on: ${{ matrix.os }} |
| 85 | + |
| 86 | + needs: create-release |
| 87 | + if: ${{ always() && !cancelled() && needs.create-release.result == 'success' }} |
| 88 | + steps: |
| 89 | + - name: Checkout |
| 90 | + uses: actions/checkout@v4 |
| 91 | + |
| 92 | + - name: Setup Python |
| 93 | + uses: actions/setup-python@v5 |
| 94 | + with: |
| 95 | + python-version: '3.13' |
| 96 | + cache: 'pip' |
| 97 | + cache-dependency-path: 'requirements.txt' |
| 98 | + |
| 99 | + - name: Install dependencies |
| 100 | + run: | |
| 101 | + python -m pip install -r requirements.txt |
| 102 | + |
| 103 | + - run: | |
| 104 | + cd src |
| 105 | + python -m PyInstaller --distpath ../dist/ --workpath ../pc_build -y ../postcompiler.spec |
| 106 | + shell: bash |
| 107 | +
|
| 108 | + - name: Pack files |
| 109 | + uses: TheDoctor0/zip-release@0.7.6 |
| 110 | + with: |
| 111 | + filename: Release-${{ runner.os }}.zip |
| 112 | + directory: ./dist/ |
| 113 | + |
| 114 | + - run: git fetch --tags origin |
| 115 | + |
| 116 | + - name: Get previous tag |
| 117 | + id: previoustag |
| 118 | + uses: 'WyriHaximus/github-action-get-previous-tag@v1' |
| 119 | + env: |
| 120 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 121 | + |
| 122 | + - name: Upload to release |
| 123 | + uses: softprops/action-gh-release@v1 |
| 124 | + if: ${{ github.event.inputs.version == '' }} |
| 125 | + with: |
| 126 | + tag_name: ${{ steps.previoustag.outputs.tag }} |
| 127 | + files: dist/Release-${{ runner.os }}.zip |
| 128 | + fail_on_unmatched_files: true |
0 commit comments