Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aded GitHub Actions workflows #2

Merged
merged 10 commits into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/release_message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Automated release via GitHub Actions.
24 changes: 24 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
aname: Development

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
arch: [x64, x86]
mode: [DebugMDd, DebugMTd, ReleaseMD, ReleaseMT]
steps:
- uses: actions/checkout@v2

- uses: microsoft/setup-msbuild@v1.1
with:
msbuild-architecture: ${{ matrix.arch }}

- name: Compile
run: MSBuild.exe /p:Configuration=${{ matrix.mode }} /p:Platform=${{ matrix.arch }} /maxcpucount:16 "liblzma.sln"
181 changes: 181 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
name: GitHub Release

on:
push:
tags:
- '*'

jobs:
build:
runs-on: windows-latest
strategy:
matrix:
arch: [x64, x86]
mode: [DebugMDd, DebugMTd, ReleaseMD, ReleaseMT]
steps:
- uses: actions/checkout@v2

- uses: microsoft/setup-msbuild@v1.1
with:
msbuild-architecture: ${{ matrix.arch }}

- name: Compile
run: MSBuild.exe /p:Configuration=${{ matrix.mode }} /p:Platform=${{ matrix.arch }} /maxcpucount:16 "liblzma.sln"

- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.mode }}-${{ matrix.arch }}
path: build/${{ matrix.mode }}-${{ matrix.arch }}/liblzma.lib

- name: Upload liblzma.pdb artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.mode }}-${{ matrix.arch }}-PDB
path: build/${{ matrix.mode }}-${{ matrix.arch }}/liblzma.pdb
if: ${{ matrix.mode != 'Release' }}

publish:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2

- name: Download x86 liblzma artifact (MDd)
uses: actions/download-artifact@v3
with:
name: DebugMDd-x86
path: build/x86/md/Debug

- name: Download x86 PDB artifact (MDd)
uses: actions/download-artifact@v3
with:
name: DebugMDd-x86-PDB
path: build/x86/md/Debug

- name: Download x64 liblzma artifact (MDd)
uses: actions/download-artifact@v3
with:
name: DebugMDd-x64
path: build/x64/md/Debug

- name: Download x64 PDB artifact (MDd)
uses: actions/download-artifact@v3
with:
name: DebugMDd-x64-PDB
path: build/x64/md/Debug

- name: Download x86 liblzma artifact (MTd)
uses: actions/download-artifact@v3
with:
name: DebugMTd-x86
path: build/x86/mt/Debug

- name: Download x86 PDB artifact (MTd)
uses: actions/download-artifact@v3
with:
name: DebugMTd-x86-PDB
path: build/x86/mt/Debug

- name: Download x64 liblzma artifact (MTd)
uses: actions/download-artifact@v3
with:
name: DebugMTd-x64
path: build/x64/mt/Debug

- name: Download x64 PDB artifact (MTd)
uses: actions/download-artifact@v3
with:
name: DebugMTd-x64-PDB
path: build/x64/mt/Debug

- name: Download x86 liblzma artifact (MD)
uses: actions/download-artifact@v3
with:
name: ReleaseMD-x86
path: build/x86/md/Release

- name: Download x86 PDB artifact (MD)
uses: actions/download-artifact@v3
with:
name: ReleaseMD-x86-PDB
path: build/x86/md/Release

- name: Download x64 liblzma artifact (MD)
uses: actions/download-artifact@v3
with:
name: ReleaseMD-x64
path: build/x64/md/Release

- name: Download x64 PDB artifact (MD)
uses: actions/download-artifact@v3
with:
name: ReleaseMD-x64-PDB
path: build/x64/md/Release

- name: Download x86 liblzma artifact (MT)
uses: actions/download-artifact@v3
with:
name: ReleaseMT-x86
path: build/x86/md/Release

- name: Download x86 PDB artifact (MT)
uses: actions/download-artifact@v3
with:
name: ReleaseMT-x86-PDB
path: build/x86/md/Release

- name: Download x64 liblzma artifact (MT)
uses: actions/download-artifact@v3
with:
name: ReleaseMT-x64
path: build/x64/md/Release

- name: Download x64 PDB artifact (MT)
uses: actions/download-artifact@v3
with:
name: ReleaseMT-x64-PDB
path: build/x64/md/Release

- name: Delete workflow artifacts
uses: geekyeggo/delete-artifact@v1
with:
name: |
DebugMDd-x86
DebugMDd-x86-PDB
DebugMDd-x64
DebugMDd-x64-PDB
DebugMTd-x86
DebugMTd-x86-PDB
DebugMTd-x64
DebugMTd-x64-PDB
ReleaseMD-x86
ReleaseMD-x86-PDB
ReleaseMD-x64
ReleaseMD-x64-PDB
ReleaseMT-x86
ReleaseMT-x86-PDB
ReleaseMT-x64
ReleaseMT-x64-PDB

- name: Create .zip archive
run: |
mkdir -p liblzma
mv build liblzma/lib
mv include liblzma

if ! hash zip 2>/dev/null; then
apt install -y zip
fi

zip -r "liblzma-msvc.zip" liblzma
env:
VERSION_TAG: ${{ github.ref_name }}

- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
artifacts: "liblzma-msvc.zip"
bodyFile: .github/release_message.md
token: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions gen_hashes
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

SCRIPT_DIR="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)"
SCRIPT_DIR_LEN=${#SCRIPT_DIR}
((SCRIPT_DIR_LEN++))

FILE_DIRECTORIES=(
'include'
'src'
)

LOCK_FILE="${SCRIPT_DIR}/liblzma.lock"

if test -f "${LOCK_FILE}"; then
rm "${LOCK_FILE}";
fi

for base_dir in "${FILE_DIRECTORIES[@]}"; do
find "${SCRIPT_DIR}/${base_dir}" -type f | while read filename; do
file_hash=$(sha1sum "$filename" | cut -d ' ' -f 1)
echo "${file_hash} ${filename:$SCRIPT_DIR_LEN}" >> "${LOCK_FILE}"
done
done
23 changes: 23 additions & 0 deletions liblzma.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
b2458f00ba10e26dcd17224694ce444a18a1a658 include/7zTypes.h
9043b8ab4c9e1184bca29d854d9aa6b737698db8 include/Alloc.h
72ad5119d6e02a7e98ee61e98cf9d8d9cb9d2e2b include/Compiler.h
dcee50d083ea40b7ef34904d618faad0e1cc141a include/LzFind.h
221d8465f317ac9159c33fee5ecdcd8499a5e237 include/LzHash.h
bf1b3d4fcc2b7f58b7a7fb9519ebaa557f6ee466 include/LzmaDec.h
e31ffa7070181fd9bbd81ddb768d3e92602d2827 include/LzmaEnc.h
ac1abaeef2476f704502452ed1de8f71f143739f include/LzmaLib.h
0caad3c72528b82a6b7cc36c9e3e2fd252c1bc09 include/Precomp.h
a7536cfd894d3df25f11672d028841e9b084ee14 include/win/LzFindMt.h
1f25dde51947cf4bef8cfbf7e2e4df96f3820170 include/win/Threads.h
ee550ffdc4aa56eda045c46d2f47cd3c36eafd10 src/Alloc.c
c78e25ad0accb8a7b7d5c79341d6dd587501129c src/LzFind.c
c56f428021731806dd175a96a4dbcbafb0fd1dd6 src/LzmaDec.c
766c8bc420ab608c09a81eb29432bbf15cd20a7b src/LzmaEnc.c
91182a18fcad78a0ba50c431e6d9bab9684a727b src/LzmaLib.c
b745fe10a1debc105acb98457b976d5c8a79e46c src/win/7zVersion.h
c553c7750e53ba01ca50b8dce558275cc36df003 src/win/7zVersion.rc
d2a14d2220b95fadef9ababf1b96700299d8960d src/win/LzFindMt.c
d698c9e022e6fe1caea1fab11221eef02c03d921 src/win/LzmaLib.def
b2dc6147e1935223bbb40145192dd2180e54f1c6 src/win/LzmaLibExports.c
35a0df80765fc5c9a1485f5b0a0ac7992ee07c44 src/win/resource.rc
e47b1ce193f4d53f21ff4be98f2c1ad3136bd331 src/win/Threads.c
36 changes: 24 additions & 12 deletions liblzma.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,32 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblzma", "liblzma.vcxproj"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
DebugMDd|x64 = DebugMDd|x64
DebugMDd|x86 = DebugMDd|x86
DebugMTd|x64 = DebugMTd|x64
DebugMTd|x86 = DebugMTd|x86
ReleaseMD|x64 = ReleaseMD|x64
ReleaseMD|x86 = ReleaseMD|x86
ReleaseMT|x64 = ReleaseMT|x64
ReleaseMT|x86 = ReleaseMT|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Debug|x64.ActiveCfg = Debug|x64
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Debug|x64.Build.0 = Debug|x64
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Debug|x86.ActiveCfg = Debug|Win32
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Debug|x86.Build.0 = Debug|Win32
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Release|x64.ActiveCfg = Release|x64
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Release|x64.Build.0 = Release|x64
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Release|x86.ActiveCfg = Release|Win32
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.Release|x86.Build.0 = Release|Win32
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMDd|x64.ActiveCfg = DebugMDd|x64
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMDd|x64.Build.0 = DebugMDd|x64
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMDd|x86.ActiveCfg = DebugMDd|Win32
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMDd|x86.Build.0 = DebugMDd|Win32
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMTd|x64.ActiveCfg = DebugMTd|x64
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMTd|x64.Build.0 = DebugMTd|x64
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMTd|x86.ActiveCfg = DebugMTd|Win32
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.DebugMTd|x86.Build.0 = DebugMTd|Win32
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMD|x64.ActiveCfg = ReleaseMD|x64
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMD|x64.Build.0 = ReleaseMD|x64
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMD|x86.ActiveCfg = ReleaseMD|Win32
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMD|x86.Build.0 = ReleaseMD|Win32
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMT|x64.ActiveCfg = ReleaseMT|x64
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMT|x64.Build.0 = ReleaseMT|x64
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMT|x86.ActiveCfg = ReleaseMT|Win32
{27DB24C1-C679-4CEF-97A6-C22F5CC08FF6}.ReleaseMT|x86.Build.0 = ReleaseMT|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading