-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workflows are borrowed from grfcodec.
- Loading branch information
Showing
17 changed files
with
422 additions
and
398 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
source: | ||
name: Source | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Generate .version | ||
run: | | ||
cmake -DWRITE_VERSION=1 -P generate_version.cmake | ||
- name: Create bundles | ||
run: | | ||
FOLDER_NAME=catcodec-${{ github.event.release.tag_name }} | ||
# Rename the folder to catcodec-NNN | ||
mkdir ${FOLDER_NAME} | ||
find . -maxdepth 1 -not -name . -not -name .git -not -name ${FOLDER_NAME} -exec mv {} ${FOLDER_NAME}/ \; | ||
mkdir -p build/bundles | ||
echo "::group::Create tarball (xz) bundle" | ||
tar --xz -cvf build/bundles/${FOLDER_NAME}-source.tar.xz ${FOLDER_NAME} | ||
echo "::endgroup::" | ||
echo "::group::Create zip bundle" | ||
zip -9 -r build/bundles/${FOLDER_NAME}-source.zip ${FOLDER_NAME} | ||
echo "::endgroup::" | ||
- name: Store bundles | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release upload ${{ github.event.release.tag_name }} build/bundles/* | ||
windows: | ||
needs: source | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
arch: [x86, x64] | ||
|
||
name: Windows (${{ matrix.arch }}) | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Prepare build dir for gh usage | ||
shell: bash | ||
run: | | ||
git init build | ||
cd build | ||
git remote add origin ${{ github.event.repository.html_url }} | ||
- name: Download source | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
shell: bash | ||
run: | | ||
cd build | ||
gh release download ${{ github.event.release.tag_name }} -p "*.xz" -D .. | ||
- name: Unpack source | ||
shell: bash | ||
run: | | ||
tar --xz -xf *-source.tar.xz --strip-components=1 | ||
- name: Install MSVC problem matcher | ||
uses: ammaraskar/msvc-problem-matcher@master | ||
|
||
- name: Configure developer command prompt for ${{ matrix.arch }} | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: ${{ matrix.arch }} | ||
|
||
- name: Build | ||
shell: bash | ||
run: | | ||
cd build | ||
echo "::group::CMake" | ||
cmake .. \ | ||
-GNinja \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
# EOF | ||
echo "::endgroup::" | ||
echo "::group::Build" | ||
cmake --build . | ||
echo "::endgroup::" | ||
- name: Create bundles | ||
shell: bash | ||
run: | | ||
cd build | ||
echo "::group::Run CPack" | ||
cpack | ||
echo "::endgroup::" | ||
- name: Store bundles | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
shell: bash | ||
run: | | ||
cd build | ||
gh release upload ${{ github.event.release.tag_name }} bundles/* |
Oops, something went wrong.