Skip to content

Merge pull request #99 from neheb/conf #98

Merge pull request #99 from neheb/conf

Merge pull request #99 from neheb/conf #98

Workflow file for this run

name: Deploy Release
on:
push:
branches:
- master
permissions:
contents: write
jobs:
check:
runs-on: ubuntu-latest
outputs:
deploy: ${{ steps.git.outputs.deploy }}
steps:
- uses: actions/checkout@v3
- name: Install Python3
run: |
sudo apt install -y python3
- id: git
name: Check Commit Message
run: |
git clone https://github.com/antony-jr/QArchive qarc
cd qarc
git tag > /tmp/tags.txt
cd ..
rm -rf qarc
cat /tmp/tags.txt
result=$(python3 scripts/check.py "$(git log -1 --pretty=%B)" "/tmp/tags.txt")
echo "deploy=$result" >> $GITHUB_OUTPUT
- id: make_rel
if: steps.git.outputs.deploy != 'false'
name: Make Relase
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.git.outputs.deploy}}
run: |
git show -s --format="%b" | head -n -2 > body.md
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="$tag" \
--notes-file body.md
notify:
runs-on: ubuntu-latest
name: Notify Qt Modules Repository
needs: [check, windows-msvc]
if: needs.check.outputs.deploy != 'false'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Trigger
env:
GH_TOKEN: ${{ secrets.QTMODULES_TOKEN }}
GITHUB_TOKEN: ${{ secrets.QTMODULES_TOKEN }}
run: gh --repo antony-jr/qtmodules workflow run gh-pages
windows-msvc:
if: "!contains(github.event.head_commit.message, '[skip builds]')"
runs-on: windows-2019
needs: check
name: windows-msvc-v${{ matrix.toolset }}-${{ matrix.arch }}-qt-${{ matrix.qt_version }}-${{ matrix.build_type }}
strategy:
fail-fast: false
matrix:
qt_version: [5.15.2]
arch: [x64, x86]
build_type: [Release, Debug]
toolset: [14.0, 14.2]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: CMake
uses: lukka/get-cmake@latest
- name: MSVC
uses: TheMrMilchmann/setup-msvc-dev@v2
with:
arch: ${{ matrix.arch }}
toolset: ${{ matrix.toolset }}
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
with:
version: 1.62.0
- name: Make Output Directory
run: |
mkdir -p ${{github.workspace}}/output/QArchive
mkdir -p ${{github.workspace}}/upload
- name: Build
run: |
set QT_VERSION=${{ matrix.qt_version }}
python3 scripts/write_conan.py
mkdir build
cd build
cmake -DQARCHIVE_QT_VERSION_MAJOR=5 -DQARCHIVE_CONAN_BUILD=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ..
cmake --build . --config ${{ matrix.build_type }}
cmake --install . --prefix=${{ github.workspace }}/output/QArchive --config ${{ matrix.build_type }}
cd ..
- name: Check Contents
working-directory: ${{github.workspace}}
run: ls -R ${{ github.workspace }}/output
- name: Zip Files
run: |
cd ${{ github.workspace }}/output/
7z a ${{ github.workspace }}/upload/windows-msvc-v${{ matrix.toolset }}-qt-${{ matrix.qt_version }}-${{ matrix.arch }}-${{ matrix.build_type }}.zip QArchive
- name: Upload Builds to Continuous
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ github.workspace }}/upload/windows-msvc-v${{ matrix.toolset }}-qt-${{ matrix.qt_version }}-${{ matrix.arch }}-${{ matrix.build_type }}.zip
tag: continuous
overwrite: true
prerelease: true
release_name: "Continuous Builds"
body: "Prebuilt QArchive from latest commit on master."
- id: upload_rel
if: needs.check.outputs.deploy != 'false'
name: Upload Asset
working-directory: ${{ github.workspace }}/upload
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ needs.check.outputs.deploy }}
run: |
gh release upload "${{ env.TAG }}" --repo "${{ github.repository }}" windows-msvc-v${{ matrix.toolset }}-qt-${{ matrix.qt_version }}-${{ matrix.arch }}-${{ matrix.build_type }}.zip