Merge pull request #5 from rehlds/feature/meta-improvements #26
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: C/C++ CI | |
on: | |
push: | |
branches: [master] | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
types: [opened, reopened, synchronize] | |
release: | |
types: [published] | |
jobs: | |
windows: | |
name: 'Windows' | |
runs-on: windows-2019 | |
env: | |
solution: 'msvc/resemiclip.sln' | |
buildPlatform: 'Win32' | |
buildRelease: 'Release' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup MSBuild | |
uses: microsoft/[email protected] | |
with: | |
vs-version: '16.8' | |
- name: Build | |
run: | | |
msbuild ${{ env.solution }} -p:Configuration="${{ env.buildRelease }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false | |
- name: Copy Binary files | |
run: | | |
mkdir publish\addons\resemiclip | |
move msvc\${{ env.buildRelease }}\resemiclip_mm.dll publish\addons\resemiclip\resemiclip_mm.dll | |
- name: Deploy artifacts | |
uses: actions/[email protected] | |
with: | |
name: win32 | |
path: publish/* | |
linux: | |
name: 'Linux' | |
runs-on: ubuntu-latest | |
container: s1lentq/linux86buildtools:latest | |
outputs: | |
app-version: ${{ steps.app-version.outputs.version }} | |
env: | |
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Build using Intel C++ Compiler 19.0 | |
run: | | |
rm -rf build && CC=icc CXX=icpc cmake -B build && cmake --build build -j8 | |
- name: Reading appversion.h | |
id: app-version | |
run: | | |
if [ -e "version/appversion.h" ]; then | |
APP_VERSION=$(cat "version/appversion.h" | grep -wi '#define APP_VERSION_STRD' | sed -e 's/#define APP_VERSION_STRD[ \t\r\n\v\f]\+\(.*\)/\1/i' -e 's/\r//g') | |
if [ $? -ne 0 ]; then | |
APP_VERSION="" | |
else | |
# Remove quotes | |
APP_VERSION=$(echo $APP_VERSION | xargs) | |
fi | |
fi | |
echo "version=${APP_VERSION}" >> "$GITHUB_OUTPUT" | |
shell: bash | |
- name: Prepare Config files | |
run: | | |
mkdir -p publish/addons/resemiclip | |
rsync -a dist/ publish/addons/resemiclip/ | |
- name: Copy Binary files | |
run: | | |
mv build/resemiclip_mm_i386.so publish/addons/resemiclip/resemiclip_mm_i386.so | |
- name: Deploy artifacts | |
uses: actions/[email protected] | |
id: upload-job | |
with: | |
name: linux32 | |
path: publish/* | |
publish: | |
name: 'Publish' | |
runs-on: ubuntu-latest | |
needs: [windows, linux] | |
steps: | |
- name: Deploying linux artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: linux32 | |
- name: Deploying windows artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: win32 | |
- name: Packaging binaries | |
id: packaging-job | |
if: | | |
github.event_name == 'release' && | |
github.event.action == 'published' && | |
startsWith(github.ref, 'refs/tags/') | |
run: | | |
7z a -tzip resemiclip-${{ needs.linux.outputs.app-version }}.zip addons/ | |
- name: Publish artifacts | |
uses: softprops/action-gh-release@v1 | |
id: publish-job | |
if: | | |
startsWith(github.ref, 'refs/tags/') && | |
steps.packaging-job.outcome == 'success' | |
with: | |
files: | | |
*.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.API_TOKEN }} |