summaryrefslogtreecommitdiffstats
path: root/.github/workflows/release-linux.yml
blob: 54cbd8c26f4495a6b8bceebed4eafac47a08cf1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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