This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
Update README.md #24
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: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
strategy: | |
fail-fast: true | |
matrix: | |
build: [ | |
nmake_cl_x64_release, | |
nmake_cl_x86_release, | |
nmake_cl_ARM64_release, | |
] | |
include: | |
- { build: nmake_cl_x64_release, arch: amd64, platform: x64, } | |
- { build: nmake_cl_x86_release, arch: amd64_x86, platform: x86, } | |
- { build: nmake_cl_ARM64_release, arch: amd64_arm64, platform: ARM64, } | |
env: | |
BUILD_TYPE: Release | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v2 | |
- name: Get version | |
shell: bash | |
run: | | |
export VERSION_MAJOR=$(grep "NETBOX_VERSION_MAJOR" src/NetBox/plugin_version.hpp | sed -e "s/^.* NETBOX_VERSION_MAJOR\s*\([0-9]\+\)/\1/g") | |
export VERSION_MINOR=$(grep "NETBOX_VERSION_MINOR" src/NetBox/plugin_version.hpp | sed -e "s/^.* NETBOX_VERSION_MINOR\s*\([0-9]\+\)/\1/g") | |
export VERSION_PATCH=$(grep "NETBOX_VERSION_PATCH" src/NetBox/plugin_version.hpp | sed -e "s/^.* NETBOX_VERSION_PATCH\s*\([0-9]\+\)/\1/g") | |
export VERSION_BUILD=$(grep "NETBOX_VERSION_BUILD" src/NetBox/plugin_version.hpp | sed -e "s/^.* NETBOX_VERSION_BUILD\s*\([0-9]\+\)/\1/g") | |
echo "VERSION=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH.$VERSION_BUILD.$GITHUB_RUN_NUMBER">> $GITHUB_ENV | |
- name: Set the pack file name | |
shell: bash | |
run: | | |
echo "netbox_name=NetBox.${{ matrix.platform }}.${{ env.version }}.7z" >> $GITHUB_ENV | |
echo "netbox_pdb_name=NetBox.${{ matrix.platform }}.${{ env.version }}.pdb.7z" >> $GITHUB_ENV | |
- name: Add C++ build tools to PATH | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- name: Create Build forlder | |
run: cmake -E make_directory build | |
- name: Configure CMake | |
shell: bash | |
working-directory: build | |
run: > | |
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPROJECT_PLATFORM=${{ matrix.platform }} $GITHUB_WORKSPACE/src/NetBox | |
- name: Build | |
working-directory: build | |
shell: bash | |
run: cmake --build . --config $BUILD_TYPE | |
- name: pack plugin | |
shell: bash | |
run: | | |
cp LICENSE.txt README.md README.RU.md README.PL.md ./Far3_${{ matrix.platform }}/Plugins/NetBox/ | |
7z a -m0=LZMA -mf=BCJ2 -mx9 ${{ env.netbox_name }} ./Far3_${{ matrix.platform }}/Plugins/* -xr!*.pdb | |
7z a -m0=LZMA -mf=off -mx9 ${{ env.netbox_pdb_name }} ./Far3_${{ matrix.platform }}/Plugins/NetBox/NetBox.pdb | |
- name: Upload result | |
uses: actions/upload-artifact@v2 | |
with: | |
name: result | |
path: ./*.7z | |
retention-days: 1 | |
create-release: | |
needs: [build] | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v2 | |
- name: Get version | |
shell: bash | |
run: | | |
export VERSION_MAJOR=$(grep "NETBOX_VERSION_MAJOR" src/NetBox/plugin_version.hpp | sed -e "s/^.* NETBOX_VERSION_MAJOR\s*\([0-9]\+\)/\1/g") | |
export VERSION_MINOR=$(grep "NETBOX_VERSION_MINOR" src/NetBox/plugin_version.hpp | sed -e "s/^.* NETBOX_VERSION_MINOR\s*\([0-9]\+\)/\1/g") | |
export VERSION_PATCH=$(grep "NETBOX_VERSION_PATCH" src/NetBox/plugin_version.hpp | sed -e "s/^.* NETBOX_VERSION_PATCH\s*\([0-9]\+\)/\1/g") | |
export VERSION_BUILD=$(grep "NETBOX_VERSION_BUILD" src/NetBox/plugin_version.hpp | sed -e "s/^.* NETBOX_VERSION_BUILD\s*\([0-9]\+\)/\1/g") | |
echo "VERSION=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH.$VERSION_BUILD.$GITHUB_RUN_NUMBER">> $GITHUB_ENV | |
- name: Download result | |
uses: actions/download-artifact@v2 | |
with: | |
name: result | |
- name: Create release | |
shell: bash | |
run: gh release create v${{ env.version }} -t "v${{ env.version }}" -n "NetBox ${{ env.version }}" ./*.7z | |
env: | |
GITHUB_TOKEN: ${{secrets.PACKAGES_GITHUB_TOKEN}} |