Skip to content

Commit

Permalink
GitHub Actions を入れてみる
Browse files Browse the repository at this point in the history
  • Loading branch information
melpon committed Nov 15, 2023
1 parent d3f17b1 commit 6a86b00
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/actions/download/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: download-artifact

description: Download Artifact

inputs:
platform:
description: Platform
required: true

runs:
using: composite
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ inputs.platform }}.env
path: ${{ inputs.platform }}.env
- name: Env to output
shell: bash
run: |
sed -i 's/\r//g' ${{ inputs.platform }}.env/sorac.env
source ${{ inputs.platform }}.env/sorac.env
echo "package_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT
echo "$PACKAGE_NAME/$PACKAGE_NAME" >> package_paths.env
id: env
- uses: actions/download-artifact@v3
with:
name: ${{ steps.env.outputs.package_name }}
path: ${{ steps.env.outputs.package_name }}
94 changes: 94 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: build-workflow

on:
push:
paths-ignore:
- "doc/**"
- "**.md"
- "LICENSE"
- "NOTICE"

jobs:
build-macos:
strategy:
fail-fast: false
matrix:
name:
- macos_arm64
name: Build sora-c-sdk for ${{ matrix.name }}
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- run: python3 run.py --sumomo --package ${{ matrix.name }}
- name: Get package name
run: |
source _package/${{ matrix.name }}/release/sorac.env
echo "name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT
id: package_name
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.package_name.outputs.name }}
path: _package/${{ matrix.name }}/release/${{ steps.package_name.outputs.name }}
- name: Upload Environment
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}.env
path: _package/${{ matrix.name }}/release/sorac.env
build-ubuntu:
strategy:
fail-fast: false
matrix:
name:
- ubuntu-20.04_x86_64
- ubuntu-22.04_x86_64
name: Build sora-c-sdk for ${{ matrix.name }}
runs-on: ${{ matrix.name == 'ubuntu-22.04_x86_64' && 'ubuntu-22.04' || 'ubuntu-20.04' }}
steps:
- uses: actions/checkout@v4
- run: python3 run.py --sumomo --package ${{ matrix.name }}
- name: Get package name
run: |
source _package/${{ matrix.name }}/release/sorac.env
echo "name=${PACKAGE_NAME}" >> $GITHUB_OUTPUT
id: package_name
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.package_name.outputs.name }}
path: _package/${{ matrix.name }}/release/${{ steps.package_name.outputs.name }}
- name: Upload Environment
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}.env
path: _package/${{ matrix.name }}/release/sorac.env
create-release:
name: Create Release
if: contains(github.ref, 'tags/202')
needs:
- build-macos
- build-ubuntu
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/download
with:
platform: macos_arm64
- uses: ./.github/actions/download
with:
platform: ubuntu-20.04_x86_64
- uses: ./.github/actions/download
with:
platform: ubuntu-22.04_x86_64
- uses: ./.github/actions/download
with:
platform: android
- name: Env to output
run: |
echo "package_paths<<EOF" >> $GITHUB_OUTPUT
cat package_paths.env >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
id: env
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.env.outputs.package_paths }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/_source
/_build
/_install
/_package
/run.sh
/libopenh264-*.so
/libopenh264-*.dylib
Expand Down

0 comments on commit 6a86b00

Please sign in to comment.