Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 committed Dec 1, 2021
1 parent 82f37d4 commit ef44dae
Showing 1 changed file with 2 additions and 103 deletions.
105 changes: 2 additions & 103 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,72 +11,6 @@ permissions:
contents: write

jobs:
build:
name: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
defaults:
run:
shell: bash
steps:
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- uses: actions/checkout@v1
with:
submodules: true

- name: install ninja (macos)
run: brew install ninja
if: matrix.os == 'macos-latest'

- name: install ninja (win)
run: choco install ninja
if: matrix.os == 'windows-latest'

- name: mkdir
run: mkdir -p out

- name: cmake (macos)
run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install
if: matrix.os == 'macos-latest'

- name: cmake (win)
# -G "Visual Studio 15 2017"
run: cmake -S . -B out -DCMAKE_INSTALL_PREFIX=out/install
if: matrix.os == 'windows-latest'

- name: build
run: cmake --build out --config Release --target install

- name: strip
run: find out/install/ -type f -perm -u=x -exec strip -x {} +
if: matrix.os != 'windows-latest'

- name: archive
id: archive
run: |
OSNAME=$(echo ${{ matrix.os }} | sed 's/-latest//')
VERSION=${{ github.event.release.tag_name }}
PKGNAME="binaryen-$VERSION-x86_64-$OSNAME"
TARBALL=$PKGNAME.tar.gz
SHASUM=$PKGNAME.tar.gz.sha256
mv out/install binaryen-$VERSION
tar -czf $TARBALL binaryen-$VERSION
# on Windows, MSYS2 will strip the carriage return from CMake output
cmake -E sha256sum $TARBALL > $SHASUM
echo "::set-output name=tarball::$TARBALL"
echo "::set-output name=shasum::$SHASUM"
- name: upload tarball
uses: softprops/action-gh-release@v1
with:
files: |
${{ steps.archive.outputs.tarball }}
${{ steps.archive.outputs.shasum }}
# Build with gcc 6.3 and run tests on Alpine Linux (inside chroot).
# Note: Alpine uses musl libc.
build-alpine:
Expand All @@ -87,48 +21,13 @@ jobs:
with:
python-version: '3.x'
- uses: actions/checkout@v1
- name: start docker
run: |
docker run -w /src -dit --name alpine -v $PWD:/src node:lts-alpine
echo 'docker exec alpine "$@";' > ./alpine.sh
chmod +x ./alpine.sh
- name: install packages
run: |
./alpine.sh apk update
./alpine.sh apk add build-base cmake git python3 clang ninja py3-pip
- name: install python dev dependencies
run: ./alpine.sh pip3 install -r requirements-dev.txt

- name: cmake
run: |
./alpine.sh cmake . -G Ninja -DCMAKE_CXX_FLAGS="-static" -DCMAKE_C_FLAGS="-static" -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC_LIB=ON -DCMAKE_INSTALL_PREFIX=install

- name: build
run: |
./alpine.sh ninja install
- name: test
run: ./alpine.sh python3 ./check.py

- name: archive
id: archive
run: |
VERSION=${{ github.event.release.tag_name }}
PKGNAME="binaryen-$VERSION-x86_64-linux"
TARBALL=$PKGNAME.tar.gz
SHASUM=$PKGNAME.tar.gz.sha256
./alpine.sh find install/ -type f -perm -u=x -exec strip {} +
mv install binaryen-$VERSION
tar -czf $TARBALL binaryen-$VERSION
cmake -E sha256sum $TARBALL > $SHASUM
echo "::set-output name=tarball::$TARBALL"
echo "::set-output name=shasum::$SHASUM"
echo ${{ github.sha }} > Release.txt
- name: upload tarball
uses: softprops/action-gh-release@v1
with:
files: |
${{ steps.archive.outputs.tarball }}
${{ steps.archive.outputs.shasum }}
Release.txt

0 comments on commit ef44dae

Please sign in to comment.