mirror of
https://github.com/asherkin/accelerator.git
synced 2025-12-06 18:08:30 +00:00
Merge 8184ead470 into 38f7e5d6f2
This commit is contained in:
commit
af77bdf868
81
.github/workflows/build-extension.yml
vendored
81
.github/workflows/build-extension.yml
vendored
@ -36,6 +36,9 @@ jobs:
|
||||
|
||||
env:
|
||||
SOURCEMOD: ${{ github.workspace }}/${{ inputs.cache-dir }}/sourcemod
|
||||
PROJECT: 'accelerator'
|
||||
PROJECT_OS: ${{ inputs.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@ -50,6 +53,15 @@ jobs:
|
||||
key: ${{ inputs.cache-key }}
|
||||
fail-on-cache-miss: true
|
||||
enableCrossOsArchive: true
|
||||
|
||||
# https://stackoverflow.com/a/64195658
|
||||
# i hate github actions
|
||||
- name: Add SHORT_SHA env property with commit short sha
|
||||
shell: bash
|
||||
run: |
|
||||
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
|
||||
echo ${{ env.SHORT_SHA }}
|
||||
|
||||
|
||||
- name: Linux dependencies
|
||||
if: startsWith(runner.os, 'Linux')
|
||||
@ -60,7 +72,9 @@ jobs:
|
||||
gcc-multilib g++-multilib libstdc++6 lib32stdc++6 \
|
||||
libc6-dev libc6-dev-i386 linux-libc-dev \
|
||||
linux-libc-dev:i386 lib32z1-dev \
|
||||
zlib1g-dev:i386 zlib1g-dev ${{ inputs.cc }}
|
||||
zlib1g-dev:i386 zlib1g-dev \
|
||||
tree \
|
||||
${{ inputs.cc }}
|
||||
|
||||
- name: Select clang compiler
|
||||
if: startsWith(runner.os, 'Linux')
|
||||
@ -89,14 +103,67 @@ jobs:
|
||||
|
||||
- name: Build (Release)
|
||||
if: not ${{ inputs.debug }}
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p build && cd build
|
||||
python ../configure.py --enable-optimize
|
||||
ambuild
|
||||
ZIP_FILENAME="${{ env.PROJECT }}-${{ env.SHORT_SHA }}-${{ env.PROJECT_OS }}.zip"
|
||||
echo ${ZIP_FILENAME}
|
||||
echo "ZIP_FILENAME=${ZIP_FILENAME}" >> $GITHUB_ENV
|
||||
|
||||
- name: Upload package
|
||||
if: ${{ inputs.upload }}
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.upload-artifact-name }}
|
||||
path: build/package
|
||||
|
||||
#- name: Upload package
|
||||
# if: ${{ inputs.upload }}
|
||||
# uses: actions/upload-artifact@v4
|
||||
# with:
|
||||
# name: ${{ inputs.upload-artifact-name }}
|
||||
# path: build/package
|
||||
|
||||
- name: Package release - Windows
|
||||
if: ${{ startsWith(env.PROJECT_OS, 'windows-latest') }}
|
||||
# shell: pwsh
|
||||
working-directory: build/package
|
||||
run: |
|
||||
Compress-Archive -Path * -Destination ${{ env.ZIP_FILENAME }}
|
||||
Copy-Item -Path ${{ env.ZIP_FILENAME }} -Destination ${{ matrix.os }}_${{ matrix.cc }}_${{ env.ZIP_FILENAME }}
|
||||
|
||||
- name: Package release - Linux
|
||||
if: ${{ startsWith(env.PROJECT_OS, 'ubuntu-22.04') }}
|
||||
working-directory: build/package
|
||||
run: |
|
||||
zip -r "${{ env.ZIP_FILENAME }}" .
|
||||
cp "${{ env.ZIP_FILENAME }}" "${{ matrix.os }}_${{ matrix.cc }}_${{ env.ZIP_FILENAME }}"
|
||||
|
||||
|
||||
- name: Upload release
|
||||
# if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
shell: bash
|
||||
working-directory: build/package
|
||||
run: |
|
||||
pwd
|
||||
ls "${{ env.ZIP_FILENAME }}" || true
|
||||
|
||||
#run: |
|
||||
# echo "Begin upload..."
|
||||
# AUTHORIZATION="$(echo -n '${{ secrets.USERNAME }}:${{ secrets.PASSWORD }}' | base64)"
|
||||
# echo "::add-mask::${AUTHORIZATION}"
|
||||
#
|
||||
# HTTP_CODE=$(curl -XPOST -H "Authorization: Basic ${AUTHORIZATION}" -H "Content-Type: application/zip" --output /dev/null --silent --write-out "%{http_code}" --data-binary "@${{ env.ZIP_FILENAME }}" "https://builds.limetech.io/upload.php?project=${{ env.PROJECT }}&filename=${{ env.ZIP_FILENAME }}")
|
||||
# if test ${HTTP_CODE} -ne 200; then
|
||||
# exit ${HTTP_CODE}
|
||||
# fi
|
||||
# echo "Upload successful!"
|
||||
|
||||
#- name: Upload a Build Artifact
|
||||
# uses: actions/upload-artifact@v4
|
||||
# with:
|
||||
# Artifact name
|
||||
# name: ${{ matrix.os }}_${{ matrix.cc }}_${{ env.ZIP_FILENAME }}
|
||||
# optional, default is artifact
|
||||
# A file, directory or wildcard pattern that describes what to upload
|
||||
# path: ${{ github.workspace }}/extension/build/package/${{ matrix.os }}_${{ matrix.cc }}_${{ env.ZIP_FILENAME }}
|
||||
# The desired behavior if no files are found using the provided path.
|
||||
# if-no-files-found: error
|
||||
# Duration after which artifact will expire in days. 0 means using default retention.
|
||||
# retention-days: 14
|
||||
|
||||
Loading…
Reference in New Issue
Block a user