Skip to content

Publish new release #54

Publish new release

Publish new release #54

Workflow file for this run

name: Publish new release
on: workflow_dispatch
jobs:
build-windows-x64:
name: Build Windows x64
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install deps
shell: bash
run: |
curl https:/protocolbuffers/protobuf/releases/download/v3.20.3/protobuf-cpp-3.20.3.zip -L --output protobuf.zip
unzip -q protobuf.zip
mv protobuf-3.20.3 protobuf
curl https://partner.steamgames.com/downloads/steamworks_sdk_158a.zip --output steamworks_sdk.zip -L
unzip -q steamworks_sdk.zip -d steamworks_sdk
- name: Build protobuf
shell: bash
run: |
cd protobuf/cmake && mkdir build
cmake -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=Release -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=.\build .
cmake --build . --config Release
cd ../..
echo "${{ github.workspace }}/protobuf/cmake/Release" >> $GITHUB_PATH
- name: Build boiler-writter
shell: bash
run: |
cmake . -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
mkdir tmp && cp -r bin tmp && rm -rf bin && mv tmp bin
- uses: actions/upload-artifact@v4
with:
name: windows-x64
path: bin
build-macos-arm64:
name: Build macOS ARM64
runs-on: macos-latest-xlarge
# TODO enable it when RM64 runners are free for public repos and adjsut the rest of the workflow
# https:/actions/runner-images/issues/8439#issuecomment-1755601587
if: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install deps
run: |
curl https:/protocolbuffers/protobuf/releases/download/v3.20.3/protobuf-cpp-3.20.3.zip -L --output protobuf.zip
unzip -q protobuf.zip
mv protobuf-3.20.3 protobuf
curl https://partner.steamgames.com/downloads/steamworks_sdk_158a.zip --output steamworks_sdk.zip -L
unzip -q steamworks_sdk.zip -d steamworks_sdk
brew install automake autoconf libtool
- name: Build protobuf
run: |
cd protobuf
./autogen.sh
./configure CXXFLAGS="-DNDEBUG"
make -j$(sysctl -n hw.physicalcpu)
sudo make install
cd ..
- name: Build boiler-writter
run: |
cmake . -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
mkdir tmp && cp -r bin tmp && rm -rf bin && mv tmp bin
- uses: actions/upload-artifact@v4
with:
name: macos-arm64
path: bin
build-macos-x64:
name: Build macOS x64
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install deps
run: |
curl https:/protocolbuffers/protobuf/releases/download/v3.20.3/protobuf-cpp-3.20.3.zip -L --output protobuf.zip
unzip -q protobuf.zip
mv protobuf-3.20.3 protobuf
curl https://partner.steamgames.com/downloads/steamworks_sdk_158a.zip --output steamworks_sdk.zip -L
unzip -q steamworks_sdk.zip -d steamworks_sdk
brew install automake
- name: Build protobuf
run: |
cd protobuf
./autogen.sh
./configure CXXFLAGS="-DNDEBUG"
make -j$(sysctl -n hw.physicalcpu)
sudo make install
cd ..
- name: Build boiler-writter
run: |
cmake . -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
mkdir tmp && cp -r bin tmp && rm -rf bin && mv tmp bin
- uses: actions/upload-artifact@v4
with:
name: macos-x64
path: bin
build-linux-x64:
name: Build Linux x64
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install deps
run: |
curl https:/protocolbuffers/protobuf/releases/download/v3.20.3/protobuf-cpp-3.20.3.zip -L --output protobuf.zip
unzip -q protobuf.zip
mv protobuf-3.20.3 protobuf
curl https://partner.steamgames.com/downloads/steamworks_sdk_158a.zip --output steamworks_sdk.zip -L
unzip -q steamworks_sdk.zip -d steamworks_sdk
sudo apt-get install build-essential autoconf gcc gcc-multilib g++-multilib libtool -y
- name: Build protobuf
run: |
cd protobuf
./autogen.sh
./configure CXXFLAGS="-DNDEBUG"
make -j$(nproc)
sudo make install
sudo ldconfig
cd ..
- name: Build boiler-writter
run: |
cmake . -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
mkdir tmp && cp -r bin tmp && rm -rf bin && mv tmp bin
- uses: actions/upload-artifact@v4
with:
name: linux-x64
path: bin
publish-release:
name: Publish release
runs-on: ubuntu-latest
needs:
[build-windows-x64, build-macos-x64, build-linux-x64]
# [build-windows-x64, build-macos-arm64, build-macos-x64, build-linux-x64]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Create new version
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
npm version minor -m "chore: v%s"
echo "VERSION=$(node -p "require('./package.json').version")" >> "$GITHUB_ENV"
- name: Build archives
run: |
cd windows-x64 && zip -r ../"boiler-writter-win-$VERSION.zip" bin && cd -
chmod +x macos-x64/bin/boiler-writter
cd macos-x64 && zip -r ../"boiler-writter-mac-$VERSION.zip" bin && cd -
chmod +x linux-x64/bin/boiler-writter
cd linux-x64 && zip -r ../"boiler-writter-linux-$VERSION.zip" bin && cd -
# chmod +x macos-arm64/bin/boiler-writter
# cd macos-arm64 && zip -r ../"boiler-writter-mac-arm64-$VERSION.zip" bin && cd -
- name: Publish NPM
run: |
mkdir -p dist/bin/{darwin-arm64,darwin-x64,linux-x64,win32-x64}
cp windows-x64/bin/* dist/bin/win32-x64
cp macos-x64/bin/* dist/bin/darwin-x64
cp linux-x64/bin/* dist/bin/linux-x64
zip -r "dist-npm.zip" dist
# cp macos-arm64/bin/* dist/bin/darwin-arm64
# npm publish --dry-run
env:
NPM_GITHUB_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_EMAIL: ${{ secrets.NPM_EMAIL }}
- name: GitHub Release
uses: ncipollo/release-action@v1
with:
tag: v${{ env.VERSION }}
allowUpdates: true
draft: true
replacesArtifacts: true
artifacts: "boiler-writter-*.zip,dist-npm.zip"
# - name: Push the tag to GitHub
# run: git push origin main --tags