-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from gammerce/change-structure
Change directory structure
- Loading branch information
Showing
14 changed files
with
191 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Amxmodx Builder Master Workflow | ||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- amxmodx-builder/** | ||
jobs: | ||
main: | ||
name: Build and push docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- version: "1.8.2" | ||
build_url: "https://www.amxmodx.org/release/amxmodx-1.8.2-base-linux.tar.gz" | ||
- version: "1.8.3" | ||
build_url: "https://www.amxmodx.org/amxxdrop/1.8/amxmodx-1.8.3-dev-git5201-base-linux.tar.gz" | ||
- version: "1.9.0" | ||
build_url: "https://www.amxmodx.org/amxxdrop/1.9/amxmodx-1.9.0-git5241-base-linux.tar.gz" | ||
- version: "1.10.0" | ||
build_url: "https://www.amxmodx.org/amxxdrop/1.10/amxmodx-1.10.0-git5392-base-linux.tar.gz" | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push to Docker Hub | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./amxmodx-builder | ||
push: true | ||
tags: budziam/amxmodx-builder:${{ matrix.version }} | ||
build-args: | | ||
BUILD_URL=${{ matrix.build_url }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Amxmodx Builder Pull Request Workflow | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- amxmodx-builder/** | ||
jobs: | ||
main: | ||
name: Build docker image | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- version: "1.8.2" | ||
build_url: "https://www.amxmodx.org/release/amxmodx-1.8.2-base-linux.tar.gz" | ||
- version: "1.8.3" | ||
build_url: "https://www.amxmodx.org/amxxdrop/1.8/amxmodx-1.8.3-dev-git5201-base-linux.tar.gz" | ||
- version: "1.9.0" | ||
build_url: "https://www.amxmodx.org/amxxdrop/1.9/amxmodx-1.9.0-git5241-base-linux.tar.gz" | ||
- version: "1.10.0" | ||
build_url: "https://www.amxmodx.org/amxxdrop/1.10/amxmodx-1.10.0-git5392-base-linux.tar.gz" | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get commit SHA | ||
id: vars | ||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push to Docker Hub | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./amxmodx-builder | ||
push: true | ||
tags: budziam/amxmodx-builder:${{ matrix.version }}-${{ steps.vars.outputs.sha_short }} | ||
build-args: | | ||
BUILD_URL=${{ matrix.build_url }} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
SM builder ![Build](https://github.com/gammerce/sourcemod-builder/workflows/Build%20docker%20image/badge.svg) | ||
Image Builder ![Build](https://github.com/gammerce/image-builder/workflows/Build%20docker%20image/badge.svg) | ||
=== |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM ubuntu:18.04 | ||
|
||
ARG BUILD_URL | ||
|
||
RUN dpkg --add-architecture i386 | ||
RUN apt-get update && apt-get install -y libc6:i386 libncurses5:i386 libstdc++6:i386 wget vim unzip inotify-tools | ||
|
||
RUN useradd -m builder | ||
USER builder | ||
|
||
RUN mkdir /home/builder/sources | ||
|
||
COPY ./compile.sh /home/builder/compile.sh | ||
COPY ./watch.sh /home/builder/watch.sh | ||
|
||
WORKDIR /home/builder | ||
RUN wget -O build.tar.gz "${BUILD_URL}" | ||
RUN tar -xzf build.tar.gz | ||
|
||
WORKDIR /home/builder/addons/amxmodx/scripting | ||
ENTRYPOINT ["/home/builder/compile.sh"] |
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# Compile all sma files | ||
for sourcefile in /home/builder/sources/*.sma; do | ||
outfile="$( basename "$sourcefile" .sma).amxx" | ||
echo "$( date +'%T' ) Compiling $sourcefile ... " | ||
|
||
if [[ $1 == "test" ]]; then | ||
if ./amxxpc -d0 $sourcefile -o/home/builder/builds/$outfile | grep -i "error"; then | ||
exit 1 | ||
fi | ||
else | ||
./amxxpc -d2 $sourcefile -o/home/builder/builds/$outfile | ||
fi | ||
done | ||
|
||
if [[ $1 == "watch" ]]; then | ||
/home/builder/watch.sh | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
inotifywait -e close_write,moved_to,create -m /home/builder/sources/ | | ||
while read -r directory events filename; do | ||
sourcefile="/home/builder/sources/$filename" | ||
outfile="$( basename "$sourcefile" .sma).amxx" | ||
|
||
echo -n "$( date +'%T' ) Compiling $sourcefile ... " | ||
|
||
./amxxpc $sourcefile -o/home/builder/builds/$outfile | ||
done |
Empty file.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 Gammerce | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
File renamed without changes.
File renamed without changes.