fix(style): fix styles and remove previous solutions #114
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
name: Release | |
on: | |
push: | |
branches: | |
- master | |
- main | |
pull_request: | |
branches: | |
- master | |
- main | |
env: | |
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules | |
jobs: | |
semantic: | |
runs-on: ubuntu-latest | |
outputs: | |
new_release_version: ${{ steps.semantic.outputs.new_release_version }} | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Semantic Release | |
id: semantic | |
uses: cycjimmy/semantic-release-action@v2 | |
with: | |
semantic_version: 19.0.2 | |
# You can specify specifying version range for the extra plugins if you prefer. | |
extra_plugins: | | |
@semantic-release/[email protected] | |
@semantic-release/[email protected] | |
@semantic-release/[email protected] | |
@semantic-release/[email protected] | |
@semantic-release/[email protected] | |
@semantic-release/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: version | |
id: version | |
run: | | |
export commit=`git rev-list --tags --max-count=1` | |
export last_release_version=`git describe --abbrev=0 --tags $tag` | |
export new_release_version=v${{ steps.semantic.outputs.new_release_version }} | |
export version=${new_release_version:-$last_release_version} | |
echo "version=${version}" >> $GITHUB_OUTPUT | |
- name: delete node_modules | |
run: | | |
rm -rf node_modules .git | |
- name: zip | |
uses: thedoctor0/zip-release@main | |
with: | |
type: zip | |
filename: ${{ steps.version.outputs.version }}.zip | |
directory: . | |
- uses: ncipollo/release-action@v1 | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' #|| startsWith(github.ref, 'refs/tags') | |
with: | |
allowUpdates: true | |
artifacts: ${{ steps.version.outputs.version }}.zip | |
tag: ${{ steps.version.outputs.version }} | |
nightly-release: | |
runs-on: ${{ matrix.os }} | |
needs: semantic | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
steps: | |
- env: | |
version: ${{needs.semantic.outputs.version}} | |
run: echo "$version" | |
- uses: actions/checkout@v3 | |
- name: cache | |
uses: actions/cache@v2 | |
with: | |
path: "**/cpm_modules" | |
key: ${{ matrix.os }}-${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} | |
- name: Install dependencies on ubuntu | |
if: startsWith(matrix.os,'ubuntu') | |
run: | | |
sudo apt update | |
sudo apt install -y build-essential cmake mesa-common-dev libgl1-mesa-dev libx11-dev mesa-common-dev mesa-utils libgl-dev python3-distutils libgl1-mesa-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev | |
- name: configure | |
run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DENABLE_TEST_COVERAGE=OFF | |
- name: build | |
if: startsWith(matrix.os,'ubuntu') == false | |
run: cmake --build build --parallel --config MinSizeRel | |
# On ubuntu, github actions doesn't support parallel build yet. should be fixed in the future. | |
- name: build | |
if: startsWith(matrix.os,'ubuntu') == true | |
run: cmake --build build --config MinSizeRel | |
- name: zip | |
uses: thedoctor0/zip-release@main | |
with: | |
type: zip | |
filename: ${{ matrix.os }}-${{ needs.semantic.outputs.version }}.zip | |
directory: build/bin/ | |
- uses: ncipollo/release-action@v1 | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' #|| startsWith(github.ref, 'refs/tags') | |
with: | |
allowUpdates: true | |
artifacts: build/bin/${{ matrix.os }}-${{ needs.semantic.outputs.version }}.zip | |
tag: ${{ needs.semantic.outputs.version }} | |
nightly-release-emscripten: | |
runs-on: ubuntu-latest | |
container: emscripten/emsdk | |
needs: semantic | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
with: | |
path: "**/cpm_modules" | |
key: emscripten-${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} | |
- name: Emscripten Build | |
run: ./scripts/emscripten-build.sh | |
- name: zip | |
uses: thedoctor0/zip-release@main | |
with: | |
type: zip | |
filename: emscripten-${{ needs.semantic.outputs.version }}.zip | |
directory: bin-emscripten/bin/ | |
- uses: ncipollo/release-action@v1 | |
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' #|| startsWith(github.ref, 'refs/tags') | |
with: | |
allowUpdates: true | |
artifacts: bin-emscripten/bin/emscripten-${{ needs.semantic.outputs.version }}.zip | |
tag: ${{ needs.semantic.outputs.version }} |