Skip to content

Commit

Permalink
Release workflow test
Browse files Browse the repository at this point in the history
  • Loading branch information
SanttuRantanen committed Dec 10, 2024
1 parent 2298a52 commit 2773b49
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 11 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Release StreamrProxyClient

on:
release:
types: [published]

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
build-desktop:
strategy:
matrix:
include:
- os: macos-14
target: arm64-osx
- os: macos-13
target: x64-osx
- os: ubuntu-24.04
target: x64-linux
- os: linux-arm64-runner
target: arm64-linux
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Install Dependencies
uses: ./.github/workflows/reusable/cached-install

- name: test
run:
./test.sh
shell: bash

- name: Package and Upload
run: |
# Only package the compiled libraries
cd ./packages/streamr-libstreamrproxyclient/dist
gh release upload ${{ github.event.release.tag_name }} streamrproxyclient-${{ matrix.target }}-*.tgz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-ios:
needs: build-desktop
runs-on: macos-14
env:
ARCHFLAGS: --ios
steps:
- uses: actions/checkout@v4

- name: Install Dependencies
uses: ./.github/workflows/reusable/cached-install

- name: Package and Upload
run: |
cd ./packages/streamr-libstreamrproxyclient/dist
gh release upload ${{ github.event.release.tag_name }} ios-swift-package/streamrproxyclient-ios-swift-package-*.tgz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-android:
needs: build-desktop
runs-on: macos-15
env:
ARCHFLAGS: --android
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0

- name: Install Dependencies
uses: ./.github/workflows/reusable/cached-install

- name: Package and Upload
run: |
cd ./packages/streamr-libstreamrproxyclient/dist
gh release upload ${{ github.event.release.tag_name }} android-library-module/streamrproxyclient-android-library-module-*.tgz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

60 changes: 49 additions & 11 deletions .github/workflows/reusable/cached-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,63 @@ description: "install dependencies, build and cache result, or restore from cach
runs:
using: "composite"
steps:
- name: cache homedir
id: cache-homedir
uses: actions/cache/restore@v4
with:
key: ${{ runner.arch }}-${{ runner.os }}-cache-homedir1-${{ hashFiles('./vcpkg.json') }}
path: |
~/.cache/vcpkg/archives
- name: cache vcpkg installed
id: cache-vcpkg-installed
uses: actions/cache/restore@v4
with:
key: ${{ runner.arch }}-${{ runner.os }}-cache-vcpkg-installed1-${{ hashFiles('./vcpkg.json') }}
path: |
./build/vcpkg_installed
- name: install-prerequisities
run:
source install-prerequisities.sh
shell: bash
- name: install
run: |
# First try the install
./install.sh --prod ${ARCHFLAGS:-} || (
echo "=== CMake Configuration Output ===" && \
cat CMakeFiles/CMakeConfigureOutput.log 2>/dev/null || true && \
echo "=== CMake Error Output ===" && \
cat CMakeFiles/CMakeError.log 2>/dev/null || true && \
# Then try to find and print any existing build logs
echo "=== Searching for build logs ===" && \
find . -type f -name "*.log" -exec sh -c 'echo "=== {} ==="; cat "{}" || true' \; && \
# Finally exit with error
for target in arm64-osx x64-osx x64-linux arm64-linux arm64-android arm64-ios; do
BASE_DIR="/Users/runner/work/native-sdk/native-sdk/vcpkg/buildtrees/libdatachannel"
# Function to print file if it exists
print_if_exists() {
if [ -f "$1" ]; then
echo "=== $2 ==="
cat "$1"
fi
}
print_if_exists "$BASE_DIR/config-$target-dbg-CMakeCache.txt.log" "config-$target-dbg-CMakeCache.txt.log"
print_if_exists "$BASE_DIR/config-$target-rel-CMakeCache.txt.log" "config-$target-rel-CMakeCache.txt.log"
print_if_exists "$BASE_DIR/config-$target-dbg-CMakeConfigureLog.yaml.log" "config-$target-dbg-CMakeConfigureLog.yaml.log"
print_if_exists "$BASE_DIR/config-$target-rel-CMakeConfigureLog.yaml.log" "config-$target-rel-CMakeConfigureLog.yaml.log"
print_if_exists "$BASE_DIR/config-$target-rel-ninja.log" "config-$target-rel-ninja.log"
print_if_exists "$BASE_DIR/config-$target-out.log" "config-$target-out.log"
print_if_exists "../../$target-dbg/CMakeCache.txt" "../../$target-dbg/CMakeCache.txt"
done
exit 1
)
shell: bash
- name: cache homedir save
id: cache-homedir-save
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.arch }}-${{ runner.os }}-cache-homedir1-${{ hashFiles('./vcpkg.json') }}
path: |
~/.cache/vcpkg/archives
- name: cache vcpkg installed save
id: cache-vcpkg-installed-save
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.arch }}-${{ runner.os }}-cache-vcpkg-installed1-${{ hashFiles('./vcpkg.json') }}
path: |
./build/vcpkg_installed

0 comments on commit 2773b49

Please sign in to comment.