|
| 1 | +name: Compile and release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + master |
| 7 | + |
| 8 | +env: |
| 9 | + PLUGIN_NAME: prophunt |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + sm-version: [ '1.12.x' ] |
| 17 | + permissions: |
| 18 | + contents: write |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Set environment variables |
| 24 | + run: echo SCRIPTS_PATH=$(pwd) >> $GITHUB_ENV |
| 25 | + |
| 26 | + - name: Download includes |
| 27 | + run: | |
| 28 | + wget -P ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting/include https://raw.githubusercontent.com/FlaminSarge/tf2attributes/master/scripting/include/tf2attributes.inc |
| 29 | + wget -P ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting/include https://raw.githubusercontent.com/asherkin/TF2Items/master/pawn/tf2items.inc |
| 30 | + wget -P ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting/include https://raw.githubusercontent.com/nosoop/SM-TFUtils/master/scripting/include/tf2utils.inc |
| 31 | + wget -P ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting/include https://raw.githubusercontent.com/nosoop/SM-TFEconData/master/scripting/include/tf_econ_data.inc |
| 32 | + wget -P ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting/include https://raw.githubusercontent.com/DoctorMcKay/sourcemod-plugins/master/scripting/include/morecolors.inc |
| 33 | + wget -P ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting/include https://raw.githubusercontent.com/sigsegv-mvm/StaticProps/master/scripting/include/StaticProps.inc |
| 34 | +
|
| 35 | + - name: Setup SourcePawn Compiler ${{ matrix.sm-version }} |
| 36 | + id: setup_sp |
| 37 | + uses: rumblefrog/setup-sp@master |
| 38 | + with: |
| 39 | + version: ${{ matrix.sm-version }} |
| 40 | + version-file: ./addons/sourcemod/scripting/${{ env.PLUGIN_NAME }}.sp |
| 41 | + define-name: PLUGIN_VERSION |
| 42 | + |
| 43 | + - name: Compile plugins |
| 44 | + run: | |
| 45 | + mkdir ../plugins |
| 46 | + spcomp -v2 -E -i "include" -o"../plugins/${{ env.PLUGIN_NAME }}.smx" ${{ env.PLUGIN_NAME }}.sp |
| 47 | + echo "===OUT FILES===" |
| 48 | + ls ../plugins |
| 49 | + echo "===VERSION===" |
| 50 | + echo ${{ steps.setup_sp.outputs.plugin-version }} |
| 51 | + working-directory: ${{ env.SCRIPTS_PATH }}/addons/sourcemod/scripting |
| 52 | + |
| 53 | + - name: Install zip |
| 54 | + uses: montudor/action-zip@v1 |
| 55 | + |
| 56 | + - name: Zip output |
| 57 | + run: | |
| 58 | + zip -qq -y -r ${{ github.event.repository.name }}.zip addons scripts |
| 59 | + working-directory: ${{ env.SCRIPTS_PATH }} |
| 60 | + |
| 61 | + - name: List files in the directory |
| 62 | + run: ls -R |
| 63 | + working-directory: ${{ env.SCRIPTS_PATH }} |
| 64 | + |
| 65 | + - name: List files in the zip |
| 66 | + run: unzip -l ${{ github.event.repository.name }}.zip |
| 67 | + working-directory: ${{ env.SCRIPTS_PATH }} |
| 68 | + |
| 69 | + - name: Create Release |
| 70 | + uses: ncipollo/release-action@v1 |
| 71 | + env: |
| 72 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 73 | + with: |
| 74 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 75 | + tag: ${{ steps.setup_sp.outputs.plugin-version }} |
| 76 | + artifacts: ${{ github.event.repository.name }}.zip |
| 77 | + draft: true |
| 78 | + allowUpdates: true |
| 79 | + updateOnlyUnreleased: true |
| 80 | + skipIfReleaseExists: true |
0 commit comments