Skip to content

Commit

Permalink
Bump version to 0.5.6.2 and add job to publish release on tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Jul 14, 2024
1 parent 0d03716 commit b719544
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 12 deletions.
65 changes: 54 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Build USVFS
on:
push:
branches: [master, dev/cmake]
tags:
- "*"
pull_request:
types: [opened, synchronize, reopened]

Expand Down Expand Up @@ -34,7 +36,7 @@ jobs:
vcpkgJsonGlob: ${{ github.workspace }}/usvfs/vcpkg.json

# configure
- run: cmake --preset vs2022-windows-${{ matrix.arch }} -B build_${{ matrix.arch }} "-DCMAKE_INSTALL_PREFIX=install"
- run: cmake --preset vs2022-windows-${{ matrix.arch }} -B build_${{ matrix.arch }} "-DCMAKE_INSTALL_PREFIX=install/${{ matrix.config }}"
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg

Expand All @@ -47,7 +49,7 @@ jobs:
- uses: actions/upload-artifact@master
with:
name: usvfs_${{ matrix.config }}_${{ matrix.arch }}
path: ./install
path: ./install/${{ matrix.config }}

# package test/dlls/etc. for tests

Expand All @@ -64,20 +66,15 @@ jobs:
name: usvfs-tests_${{ matrix.config }}_${{ matrix.arch }}
path: ./test/bin

# merge x86 / x64 artifacts
merge-artifacts:
# merge x86 / x64 artifacts for tests (root bin/lib and test folder)
merge-artifacts-for-tests:
runs-on: ubuntu-latest
name: Merge Artifacts
name: Merge Test Artifacts
needs: build
strategy:
matrix:
config: [Debug, Release]
steps:
- name: Merge USVFS install
uses: actions/upload-artifact/merge@v4
with:
name: usvfs_${{ matrix.config }}
pattern: usvfs_${{ matrix.config }}_*
- name: Merge USVFS libs
uses: actions/upload-artifact/merge@v4
with:
Expand All @@ -94,9 +91,24 @@ jobs:
name: usvfs-tests_${{ matrix.config }}
pattern: usvfs-tests_${{ matrix.config }}_*

# merge x86 / x64 artifacts (install folder)
merge-artifacts-for-release:
runs-on: ubuntu-latest
name: Merge Install Artifacts
needs: build
strategy:
matrix:
config: [Debug, Release]
steps:
- name: Merge USVFS install
uses: actions/upload-artifact/merge@v4
with:
name: usvfs_${{ matrix.config }}
pattern: usvfs_${{ matrix.config }}_*

test:
name: Test USVFS
needs: merge-artifacts
needs: merge-artifacts-for-tests
runs-on: windows-2022
strategy:
matrix:
Expand Down Expand Up @@ -136,3 +148,34 @@ jobs:
if-no-files-found: ignore
retention-days: 7
overwrite: true

publish:
if: github.ref_type == 'tag'
needs: [merge-artifacts-for-release, test]
runs-on: windows-2022
permissions:
contents: write
steps:
# USVFS does not use different names for debug and release so we are going to
# retrieve both install artifacts and put them under install/ and install/debug/

- name: Download Release Artifact
uses: actions/download-artifact@master
with:
name: usvfs_Release
path: ./install

- name: Download Debug Artifact
uses: actions/download-artifact@master
with:
name: usvfs_Debug
path: ./install/debug

- name: Create USVFS Base archive
run: 7z a usvfs_${{ github.ref_name }}.7z ./install/*

- name: Publish Release
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release create --draft=false --notes="Release ${{ github.ref_name }}" "${{ github.ref_name }}" ./usvfs_${{ github.ref_name }}.7z
2 changes: 1 addition & 1 deletion include/usvfs/usvfs_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define USVFS_VERSION_MAJOR 0
#define USVFS_VERSION_MINOR 5
#define USVFS_VERSION_BUILD 6
#define USVFS_VERSION_REVISION 1
#define USVFS_VERSION_REVISION 2

#define USVFS_BUILD_STRING ""
#define USVFS_BUILD_WSTRING L""
Expand Down

0 comments on commit b719544

Please sign in to comment.