Skip to content

GitHub Actions を入れてみる #1

GitHub Actions を入れてみる

GitHub Actions を入れてみる #1

Workflow file for this run

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 }}