You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
222 lines
6.8 KiB
YAML
222 lines
6.8 KiB
YAML
name: Release
|
|
on:
|
|
push:
|
|
tags:
|
|
- v[0-9]+.[0-9]+.[0-9]+
|
|
schedule:
|
|
- cron: '30 4 * * *'
|
|
workflow_dispatch:
|
|
inputs:
|
|
tag_name:
|
|
description: 'Tag name for release'
|
|
required: false
|
|
default: nightly
|
|
|
|
jobs:
|
|
Linux:
|
|
name: 'Build Linux Release'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get install ninja-build gettext doxygen graphviz
|
|
pip3 install conan==1.45.0
|
|
|
|
- name: Conan common config
|
|
run: |
|
|
conan profile new --detect default
|
|
conan profile update settings.build_type=Release default
|
|
conan profile update settings.compiler.libcxx=libstdc++11 default
|
|
|
|
- name: Run Conan
|
|
run: |
|
|
mkdir build && cd build
|
|
conan profile list
|
|
conan profile show default
|
|
conan install .. -o webready=False --build missing
|
|
|
|
- name: Build packaged release
|
|
run: |
|
|
cd build
|
|
cmake -GNinja -DEXIV2_TEAM_PACKAGING=ON -DBUILD_SHARED_LIBS=ON -DEXIV2_ENABLE_WEBREADY=OFF -DEXIV2_ENABLE_NLS=ON -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_BMFF=ON -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DEXIV2_BUILD_DOC=ON ..
|
|
cmake --build . -t doc
|
|
cmake --build . -t package
|
|
tree -L 3
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: exiv2-linux64
|
|
path: ./build/exiv2-*.tar.gz
|
|
if-no-files-found: error
|
|
retention-days: 1
|
|
|
|
macOS:
|
|
name: 'Build macOS Release'
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
brew install ninja
|
|
brew install tree
|
|
brew install gettext
|
|
brew install doxygen
|
|
brew install graphviz
|
|
|
|
- name: Build packaged release
|
|
run: |
|
|
mkdir build && cd build
|
|
cmake -GNinja -DEXIV2_TEAM_PACKAGING=ON -DBUILD_SHARED_LIBS=ON -DEXIV2_ENABLE_WEBREADY=OFF -DEXIV2_ENABLE_NLS=ON -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_BMFF=ON -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DEXIV2_BUILD_DOC=ON -DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" ..
|
|
cmake --build . -t doc
|
|
cmake --build . -t package
|
|
tree -L 3
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: exiv2-macos
|
|
path: ./build/exiv2-*.tar.gz
|
|
if-no-files-found: error
|
|
retention-days: 1
|
|
|
|
Windows:
|
|
name: 'Build Windows Release'
|
|
runs-on: windows-2022
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set up Visual Studio shell
|
|
uses: egor-tensin/vs-shell@v2
|
|
|
|
- name: Setup Ninja
|
|
uses: ashutoshvarma/setup-ninja@master
|
|
with:
|
|
version: 1.10.0
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.9
|
|
|
|
- name: Install doxygen
|
|
run: |
|
|
choco install doxygen.install
|
|
choco install graphviz
|
|
|
|
- name: Install Conan & Common config
|
|
run: |
|
|
pip.exe install "conan==1.45.0"
|
|
conan profile new --detect default
|
|
conan profile update settings.build_type=Release default
|
|
conan profile update settings.compiler="Visual Studio" default
|
|
conan profile update settings.compiler.version=17 default
|
|
|
|
- name: Run Conan
|
|
run: |
|
|
md build
|
|
cd build
|
|
conan install .. --build missing
|
|
|
|
- name: Build packaged release
|
|
run: |
|
|
cd build
|
|
cmake -GNinja -DEXIV2_TEAM_PACKAGING=ON -DBUILD_SHARED_LIBS=ON -DEXIV2_ENABLE_WEBREADY=OFF -DEXIV2_ENABLE_NLS=OFF -DCMAKE_BUILD_TYPE=Release -DEXIV2_ENABLE_BMFF=ON -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DEXIV2_BUILD_DOC=ON ..
|
|
cmake --build . -t doc
|
|
cmake --build . -t package
|
|
tree -L 3
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: exiv2-win
|
|
path: ./build/exiv2-*.zip
|
|
if-no-files-found: error
|
|
retention-days: 1
|
|
|
|
publish:
|
|
needs: [Linux, macOS, Windows]
|
|
runs-on: ubuntu-20.04
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
|
|
- if: github.event_name == 'workflow_dispatch'
|
|
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
|
|
|
|
- if: github.event_name == 'schedule'
|
|
run: echo 'TAG_NAME=nightly' >> $GITHUB_ENV
|
|
|
|
- if: github.event_name == 'push'
|
|
run: |
|
|
TAG_NAME=${{ github.ref }}
|
|
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
|
|
|
|
- if: env.TAG_NAME == 'nightly'
|
|
run: |
|
|
echo 'BODY<<EOF' >> $GITHUB_ENV
|
|
echo '## Exiv2 nightly prerelease build.' >> $GITHUB_ENV
|
|
echo 'Please help us improve exiv2 by reporting any issues you encounter :wink:' >> $GITHUB_ENV
|
|
echo 'EOF' >> $GITHUB_ENV
|
|
|
|
|
|
- if: env.TAG_NAME != 'nightly'
|
|
run: |
|
|
echo 'BODY<<EOF' >> $GITHUB_ENV
|
|
echo '## Exiv2 Release ${{ env.TAG_NAME }}' >> $GITHUB_ENV
|
|
echo 'See [ChangeLog](doc/ChangeLog) for more information about the changes in this release.' >> $GITHUB_ENV
|
|
echo 'EOF' >> $GITHUB_ENV
|
|
|
|
- name: Cleanup old nightly
|
|
if: env.TAG_NAME == 'nightly'
|
|
uses: actions/github-script@v4
|
|
with:
|
|
script: |
|
|
try{
|
|
const rel_id = await github.repos.getReleaseByTag({
|
|
...context.repo,
|
|
tag: "nightly"
|
|
}).then(result => result.data.id);
|
|
|
|
console.log( "Found existing nightly release with id: ", rel_id);
|
|
|
|
await github.repos.deleteRelease({
|
|
...context.repo,
|
|
release_id: rel_id
|
|
});
|
|
console.log( "Deletion of release successful")
|
|
|
|
}catch(error){
|
|
console.log( "Deletion of release failed");
|
|
console.log( "Failed with error\n", error);
|
|
}
|
|
|
|
try{
|
|
await github.git.deleteRef({
|
|
...context.repo,
|
|
ref: "tags/nightly"
|
|
});
|
|
console.log( "Deletion of tag successful")
|
|
}catch(error){
|
|
console.log( "Deletion of tag failed");
|
|
console.log( "Failed with error\n", error);
|
|
}
|
|
|
|
- uses: actions/download-artifact@v2
|
|
- name: List downloaded files
|
|
run: tree -L 3
|
|
|
|
- uses: softprops/action-gh-release@v0.1.8
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
# needs newer relase, but add it once available
|
|
#fail_on_unmatched_files: true
|
|
body: ${{ env.BODY }}
|
|
prerelease: ${{ env.TAG_NAME == 'nightly' }}
|
|
tag_name: ${{ env.TAG_NAME }}
|
|
files: |
|
|
./exiv2-linux64/exiv2-*
|
|
./exiv2-macos/exiv2-*
|
|
./exiv2-win/exiv2-*
|