Skip to content

Commit

Permalink
rework for amxxpawn
Browse files Browse the repository at this point in the history
  • Loading branch information
SergeyShorokhov authored Apr 9, 2024
1 parent e00b8ef commit 71a92af
Show file tree
Hide file tree
Showing 17 changed files with 1,880 additions and 120 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Setup and test AMXXPawn

on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:

jobs:
run:
name: Run action
runs-on: ubuntu-latest
strategy:
matrix:
amxxVersion: ['1.10.x', '1.9.x']

steps:
- uses: actions/[email protected]

- name: Setup AMXXPawn Compiler (local action)
if: github.event_name == 'pull_request'
uses: ./
with:
version: ${{ matrix.amxxVersion }}

- name: Setup AMXXPawn Compiler (master)
if: github.event_name != 'pull_request'
uses: wopox1337/setup-amxxpawn@master
with:
version: ${{ matrix.amxxVersion }}

- name: Verify compiler
run: |
echo "which amxxpc: $(which amxxpc)"
echo "includePath directory list: $includePath"
ls -l $includePath
echo "scriptingPath directory list: $scriptingPath"
ls -l $scriptingPath
amxxpc __tests__/compile.sma
27 changes: 0 additions & 27 deletions .github/workflows/dev_workflow.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/workflow.yml

This file was deleted.

1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* @rumblefrog
* @wopox1337
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 RumbleFrog
Copyright (c) 2019 woppox1337

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
50 changes: 24 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Setup SourcePawn Action
# Setup AMXXPawn Action

![](https://github.com/rumblefrog/setup-sp/workflows/Main%20Workflow/badge.svg)
![](https://github.com/wopox1337/setup-amxxpawn/workflows/Main%20Workflow/badge.svg)

This action sets-up, cache and adds sourcemod scripting directory to the path
This action sets-up, cache and adds amxmodx scripting directory to the path

# Usage

See [action.yml](https://github.com/rumblefrog/setup-sp/blob/master/action.yml)
See [action.yml](https://github.com/wopox1337/setup-amxxpawn/blob/master/action.yml)

## Basic:

```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: rumblefrog/setup-sp@master
- uses: wopox1337/setup-amxxpawn@master
with:
version: '1.12.x'
version: '1.10.x'

- run: spcomp -iAnotherIncludeDirectory plugin.sp -o output/plugin.smx
- run: amxxpc -iAnotherIncludeDirectory plugin.sma -o output/plugin.amxx
```
## Matrix:
Expand All @@ -29,41 +29,39 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
sm-version: [ '1.11.x', '1.12.x', '1.11.6467', '>= 1.11.6478']
amxx-version: [ '1.9.x', '1.10.x', '1.10.5467', '>= 1.10.5455']

name: SM version ${{ matrix.sm-version }}
name: AMXX version ${{ matrix.amxx-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup SP
uses: rumblefrog/setup-sp@master
- name: Setup AMXX
uses: wopox1337/setup-amxxpawn@master
with:
version: ${{ matrix.sm-version }}
version: ${{ matrix.amxx-version }}

- run: spcomp -iAnotherIncludeDirectory plugin.sp -o output/plugin.smx
- run: amxxpc -iAnotherIncludeDirectory plugin.sma -o output/plugin.amxx
```
## Extract the version of the .sp file:
## Extract the version of the .sma file:
```yaml
jobs:
build:
runs-on: ubuntu-latest

name: SM version ${{ matrix.sm-version }}
name: AMXX version ${{ matrix.amxx-version }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Setup SP
id: setup_sp
uses: rumblefrog/setup-sp@master
- name: Setup AMXX
id: setup_amxx
uses: wopox1337/setup-amxxpawn@master
with:
version: '1.10.x'
version-file: ./plugin.sp
version-file: ./plugin.sma

- run: |
spcomp -iAnotherIncludeDirectory plugin.sp -o output/plugin.smx
echo Plugin version ${{ steps.setup_sp.outputs.plugin-version }}
amxxpc -iAnotherIncludeDirectory plugin.sma -o output/plugin.amxx
echo Plugin version ${{ steps.setup_amxx.outputs.plugin-version }}
```
A complete workflow example can be found [here](https://github.com/Sarrus1/DiscordWebhookAPI/blob/master/.github/workflows/master.yml).
8 changes: 8 additions & 0 deletions __tests__/compile.sma
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <amxmodx>

#pragma semicolon 1

public plugin_init()
{
server_print("Hello, World!");
}
9 changes: 0 additions & 9 deletions __tests__/compile.sp

This file was deleted.

20 changes: 10 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: 'Setup SourcePawn Compiler'
author: 'rumblefrog'
description: 'Install and setup SourcePawn compiler'
name: 'Setup AMXXPawn Compiler'
author: 'wopox1337'
description: 'Install and setup AMXXPawn compiler'
inputs:
version:
description: 'Version of SP compiler'
description: 'Version of AMXX compiler'
required: true
default: '1.10.x'
version-file:
Expand All @@ -14,17 +14,17 @@ inputs:
description: 'Name of the define for the version of the plugin if you are using one'
required: false
default: ''
no-spcomp-proxy:
description: 'Whether spcomp should not be proxied to fix relative include path'
no-amxxpc-proxy:
description: 'Whether amxxpc should not be proxied to fix relative include path'
required: false
default: 'false'
default: 'true'
outputs:
version:
description: 'Version of the SP compiler used'
description: 'Version of the AMXX compiler used'
version-file:
description: 'Version of the .sp file'
description: 'Version of the .sma file'
runs:
using: 'node16'
using: 'node20'
main: 'lib/index.js'
branding:
icon: 'command'
Expand Down
3 changes: 2 additions & 1 deletion lib/index.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions lib/index.js.LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */

/*! ws. MIT License. Einar Otto Stangvik <[email protected]> */
Loading

0 comments on commit 71a92af

Please sign in to comment.