summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2020-11-17 08:57:13 -0800
committerGitHub <noreply@github.com>2020-11-17 08:57:13 -0800
commit7dd0ff9d08ca8b5f86f2a71afaa94d625c6ad64e (patch)
treef23a5f103c34126ff5c73aada46b58428af253e6
parent39709fb19e105a47e991d5a3d32663a69e5aac91 (diff)
Integrate github actions for linux deployment. (#1607)
-rw-r--r--.github/workflows/release-linux.yml71
-rw-r--r--github_build.sh2
2 files changed, 72 insertions, 1 deletions
diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml
new file mode 100644
index 000000000..54cbd8c26
--- /dev/null
+++ b/.github/workflows/release-linux.yml
@@ -0,0 +1,71 @@
+on:
+ push:
+ # Sequence of patterns matched against refs/tags
+ tags:
+ - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
+
+name: Upload Release Asset
+
+jobs:
+ build:
+ name: Upload Release Asset
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v2
+ with:
+ submodules: 'true'
+ fetch-depth: '0'
+ - name: Build release project
+ id: build
+ run: |
+ echo "starting to build..."
+ export CC=gcc
+ export CONFIGURATION=release
+ echo "building..."
+ source ./github_build.sh
+ echo "creating binary archieves..."
+ export SLANG_OS_NAME=linux
+ export SLANG_ARCH_NAME=`uname -p`
+ export TAG_NAME=`git describe --tags`
+ export SLANG_TAG=${TAG_NAME#v}
+ echo "tag:$TAG_NAME"
+ echo "slang-tag:$SLANG_TAG"
+ export SLANG_BINARY_ARCHIVE=slang-${SLANG_TAG}-${SLANG_OS_NAME}-${SLANG_ARCH_NAME}.zip
+ export SLANG_BINARY_ARCHIVE_TAR=slang-${SLANG_TAG}-${SLANG_OS_NAME}-${SLANG_ARCH_NAME}.tar.gz
+ echo "creating zip"
+ zip -r ${SLANG_BINARY_ARCHIVE} bin/*/*/slangc bin/*/*/libslang.so bin/*/*/libslang-glslang.so docs/*.md README.md LICENSE slang.h slang-com-helper.h slang-com-ptr.h slang-tag-version.h prelude/*.h
+ echo "creating tar"
+ tar -czf ${SLANG_BINARY_ARCHIVE_TAR} bin/*/*/slangc bin/*/*/libslang.so bin/*/*/libslang-glslang.so docs/*.md README.md LICENSE slang.h slang-com-helper.h slang-com-ptr.h slang-tag-version.h prelude/*.h
+ echo "::set-output name=SLANG_BINARY_ARCHIVE::${SLANG_BINARY_ARCHIVE}"
+ echo "::set-output name=SLANG_BINARY_ARCHIVE_TAR::${SLANG_BINARY_ARCHIVE_TAR}"
+ - name: Create Release
+ id: create_release
+ uses: actions/create-release@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ tag_name: ${{ github.ref }}
+ release_name: Release ${{ github.ref }}
+ draft: false
+ prerelease: false
+ - name: Upload Release Asset (zip)
+ id: upload-release-asset-zip
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
+ asset_path: ./${{ steps.build.outputs.SLANG_BINARY_ARCHIVE }}
+ asset_name: ${{ steps.build.outputs.SLANG_BINARY_ARCHIVE }}
+ asset_content_type: application/zip
+ - name: Upload Release Asset (tar)
+ id: upload-release-asset-tar
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
+ asset_path: ./${{ steps.build.outputs.SLANG_BINARY_ARCHIVE_TAR }}
+ asset_name: ${{ steps.build.outputs.SLANG_BINARY_ARCHIVE_TAR }}
+ asset_content_type: application/zip \ No newline at end of file
diff --git a/github_build.sh b/github_build.sh
index b0970a903..78a4d4211 100644
--- a/github_build.sh
+++ b/github_build.sh
@@ -11,6 +11,6 @@ cat slang-tag-version.h
./premake5 gmake --cc=${CC}
# Build the configuration
-make config=${CONFIGURATION}_x64
+make config=${CONFIGURATION}_x64 -j2