update version #75
Workflow file for this run
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: | |
tags: | |
- "v*" | |
jobs: | |
build-artifacts: | |
strategy: | |
fail-fast: false | |
matrix: | |
build: [ x64, x86 , ARM64 ] | |
include: | |
- { build: x64, arch: amd64, triplet: x64-windows-static-rel, } | |
- { build: x86, arch: amd64_x86, triplet: x86-windows-static-rel, } | |
- { build: ARM64, arch: amd64_arm64, triplet: arm64-windows-static-rel, } | |
env: | |
BUILD_TYPE: Release | |
X_VCPKG_NUGET_ID_PREFIX: 'farcolorer' | |
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite' | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Add C++ build tools to PATH | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- name: Install vcpkg | |
run: | | |
cd external\colorer\external\vcpkg | |
.\bootstrap-vcpkg.bat | |
- name: Setup NuGet Credentials for vpckg cache | |
shell: bash | |
run: > | |
`$VCPKG_INSTALLATION_ROOT/vcpkg fetch nuget | tail -n 1` | |
sources add | |
-source "https://nuget.pkg.github.com/colorer/index.json" | |
-storepasswordincleartext | |
-name "GitHub" | |
-username "${{ secrets.PACKAGES_GITHUB_USER }}" | |
-password "${{ secrets.PACKAGES_GITHUB_TOKEN }}" | |
- name: Create Build forlder | |
run: cmake -E make_directory build | |
- name: Configure CMake | |
shell: bash | |
working-directory: build | |
run: > | |
cmake $GITHUB_WORKSPACE -G "Ninja" | |
-DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
-DCOLORER_BUILD_ARCH=${{ matrix.build }} | |
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/external/colorer/external/vcpkg/scripts/buildsystems/vcpkg.cmake | |
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} | |
-DVCPKG_OVERLAY_PORTS=$GITHUB_WORKSPACE/external/colorer/external/vcpkg-ports | |
-DVCPKG_OVERLAY_TRIPLETS=$GITHUB_WORKSPACE/external/colorer/external/vcpkg-triplets | |
-DVCPKG_FEATURE_FLAGS=manifests,versions | |
-DCMAKE_INSTALL_PREFIX=./install/FarColorer | |
- name: Build | |
working-directory: build | |
shell: bash | |
run: cmake --build . --config $BUILD_TYPE | |
- name: Install | |
working-directory: build | |
shell: bash | |
run: cmake --install . --config $BUILD_TYPE | |
- name: Download scheme | |
working-directory: build | |
shell: bash | |
run: | | |
curl -s https://api.github.com/repos/colorer/Colorer-schemes/releases/latest | grep -o "https://.*colorer-base\.allpacked.*.zip" | xargs curl -fsLJO | |
zipfilename="$(find . -name "colorer-base*.zip")" | |
7z x $zipfilename -o./install/FarColorer/base | |
- name: Set the pack file name | |
shell: bash | |
run: | | |
echo "farcolorer_name=FarColorer.${{ matrix.build }}.${{ github.ref_name }}.7z" >> $GITHUB_ENV | |
echo "farcolorer_pdb_name=FarColorer.${{ matrix.build }}.${{ github.ref_name }}.pdb.7z" >> $GITHUB_ENV | |
echo "farcolorer_withoutbase_name=FarColorer.${{ matrix.build }}.${{ github.ref_name }}.wobase.7z" >> $GITHUB_ENV | |
- name: pack plugin | |
working-directory: build | |
shell: bash | |
run: | | |
7z a -m0=LZMA -mf=BCJ2 -mx9 ${{ env.farcolorer_name }} ./install/FarColorer/* | |
7z a -m0=LZMA -mf=BCJ2 -mx9 ${{ env.farcolorer_withoutbase_name }} ./install/FarColorer/* -x!./install/FarColorer/base | |
7z a -m0=LZMA -mf=off -mx9 ${{ env.farcolorer_pdb_name }} ./src/colorer.pdb | |
- name: Upload result to cache | |
uses: actions/upload-artifact@v4 | |
with: | |
name: result-${{ matrix.arch }} | |
path: ./build/*.7z | |
retention-days: 1 | |
publish-release: | |
needs: [ build-artifacts ] | |
runs-on: windows-2022 | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Download result | |
uses: actions/download-artifact@v4 | |
with: | |
path: result | |
pattern: result-* | |
merge-multiple: true | |
- name: Create release | |
shell: bash | |
run: gh release create ${{ github.ref_name }} -t "FarColorer ${{ github.ref_name }}" -n "New version" result/*.7z | |
env: | |
GITHUB_TOKEN: ${{secrets.PACKAGES_GITHUB_TOKEN}} |