Skip to content

Commit

Permalink
Add version number to the archive (#1)
Browse files Browse the repository at this point in the history
* Include version in file names

* Update build.yaml

* Update build.yaml

* Update build.yaml

* Update build.yaml

* Update build.yaml
  • Loading branch information
umireon authored Oct 16, 2023
1 parent ad6c927 commit bfb9fca
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 19 deletions.
40 changes: 34 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,26 @@ jobs:
- "Release"

steps:
- name: "Get version"
run: |
if [[ $GITHUB_REF =~ ^refs/tag/ ]]
then version="${GITHUB_REF#refs/tag/}"
else version=master
fi
echo "version=$version" > "$GITHUB_OUTPUT"
id: "get-version"

- uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Run build-macos.sh"
run: "./build-macos.sh ${{ matrix.config }}"
run: "./build-macos.sh ${{ matrix.config }} ${{ steps.get-version.outputs.version }}"

- uses: "actions/upload-artifact@v3"
with:
name: "libcurl-macos-${{ matrix.config }}"
path: "release/libcurl-macos-${{ matrix.config }}.tar.gz"
path: "release/*.tar.gz"

BuildLinux:
runs-on: "ubuntu-22.04"
Expand All @@ -43,17 +52,26 @@ jobs:
- "Release"

steps:
- name: "Get version"
run: |
if [[ $GITHUB_REF =~ ^refs/tag/ ]]
then version="${GITHUB_REF#refs/tag/}"
else version=master
fi
echo "version=$version" > "$GITHUB_OUTPUT"
id: "get-version"

- uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Run build-linux.sh"
run: "./build-linux.sh ${{ matrix.config }}"
run: "./build-linux.sh ${{ matrix.config }} ${{ steps.get-version.outputs.version }}"

- uses: "actions/upload-artifact@v3"
with:
name: "libcurl-linux-${{ matrix.config }}"
path: "release/libcurl-linux-${{ matrix.config }}.tar.gz"
path: "release/*.tar.gz"

BuildWindows:
runs-on: "windows-2022"
Expand All @@ -65,17 +83,27 @@ jobs:
- "Release"

steps:
- name: "Get version"
shell: bash
run: |
if [[ $GITHUB_REF =~ ^refs/tag/ ]]
then version="${GITHUB_REF#refs/tag/}"
else version=master
fi
echo "version=$version" > "$GITHUB_OUTPUT"
id: "get-version"

- uses: "actions/checkout@v3"
with:
submodules: "recursive"

- name: "Run Build-Windows.ps1"
run: "./Build-Windows.ps1 -Config ${{ matrix.config }}"
run: "./Build-Windows.ps1 -Configuration ${{ matrix.config }} -Version ${{ steps.get-version.outputs.version }}"

- uses: "actions/upload-artifact@v3"
with:
name: "libcurl-linux-${{ matrix.config }}"
path: "release/libcurl-windows-${{ matrix.config }}.zip"
path: "release/*.zip"

Release:
runs-on: "ubuntu-22.04"
Expand Down
6 changes: 3 additions & 3 deletions Build-Windows.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Param($Configuration)
Param($Configuration, $Version)

cmake curl -B build_$Configuration `
-DCURL_USE_OPENSSL=OFF `
Expand All @@ -9,9 +9,9 @@ cmake curl -B build_$Configuration `
-DCURL_USE_LIBSSH2=OFF `
-DBUILD_TESTING=OFF `
-DPICKY_COMPILER=OFF `
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_TYPE=$Configuration


cmake --build build_$Configuration --config $Configuration
cmake --install build_$Configuration --config $Configuration --prefix release/$Configuration
Compress-Archive release\$Configuration\* release\libcurl-windows-$Configuration.zip -Verbose
Compress-Archive release\$Configuration\* release\libcurl-windows-$Version-$Configuration.zip -Verbose
13 changes: 8 additions & 5 deletions build-linux.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
#!/bin/bash
set -euo pipefail

cmake curl -B build_$1 \
CONFIG=${1?}
VERSION=${2?}

cmake curl -B build_$CONFIG \
-DCURL_USE_OPENSSL=ON \
-DBUILD_CURL_EXE=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DHTTP_ONLY=ON \
-DCURL_USE_LIBSSH2=OFF \
-DBUILD_TESTING=OFF \
-DPICKY_COMPILER=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=$CONFIG \
-DCMAKE_C_FLAGS="-fPIC" \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON

cmake --build build_$1
cmake --install build_$1 --prefix release/$1
tar -C release/$1 -cvf release/libcurl-linux-$1.tar.gz .
cmake --build build_$CONFIG
cmake --install build_$CONFIG --prefix release/$CONFIG
tar -C release/$CONFIG -cvf release/libcurl-linux-$VERSION-$CONFIG.tar.gz .
13 changes: 8 additions & 5 deletions build-macos.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/bash
set -euo pipefail

cmake curl -B build_$1 \
CONFIG=${1?}
VERSION=${2?}

cmake curl -B build_$CONFIG \
-DCURL_USE_OPENSSL=OFF \
-DCURL_USE_SECTRANSP=ON \
-DBUILD_CURL_EXE=OFF \
Expand All @@ -10,9 +13,9 @@ cmake curl -B build_$1 \
-DCURL_USE_LIBSSH2=OFF \
-DBUILD_TESTING=OFF \
-DPICKY_COMPILER=OFF \
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_TYPE=$CONFIG


cmake --build build_$1
cmake --install build_$1 --prefix release/$1
tar -C release/$1 -cvf release/libcurl-macos-$1.tar.gz .
cmake --build build_$CONFIG
cmake --install build_$CONFIG --prefix release/$CONFIG
tar -C release/$CONFIG -cvf release/libcurl-macos-$VERSION-$1.tar.gz .

0 comments on commit bfb9fca

Please sign in to comment.