Skip to content

Commit

Permalink
Merge pull request #17 from shinolab/develop
Browse files Browse the repository at this point in the history
update actions
  • Loading branch information
s5suzuki authored Jul 26, 2024
2 parents 3cff498 + bdcdef8 commit 62facf9
Show file tree
Hide file tree
Showing 24 changed files with 686 additions and 742 deletions.
6 changes: 5 additions & 1 deletion .github/actions/setup-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@ runs:
shell: bash
if: inputs.os == 'macos-latest'
run: |
brew install git cmake ninja python@3.8
brew install ninja
- name: install dependencies
shell: bash
if: inputs.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libfreetype6-dev libfontconfig1-dev
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev librsvg2-dev
- name: setup cache
uses: swatinem/rust-cache@v2
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ updates:
directory: "/"
schedule:
interval: "weekly"
target-branch: "develop"

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
target-branch: "develop"
84 changes: 44 additions & 40 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,69 @@
name: build

on:
push:
branches:
- 'develop'
pull_request:
types: [opened, reopened, review_requested]
branches: [ "main" ]
merge_group:
types: [ checks_requested ]

jobs:
check-src:

changed-files:
name: changed-files
runs-on: ubuntu-latest
name: check if server files changed
outputs:
status: ${{ steps.changed-files.outputs.modified_files }}
src: ${{ steps.changed-files-yaml.outputs.src_any_changed }}
lightweight: ${{ steps.changed-files-yaml.outputs.lightweight_any_changed }}
miri: ${{ steps.changed-files-yaml.outputs.miri_any_changed }}
steps:
- uses: actions/checkout@v4
- uses: tj-actions/changed-files@v42
id: changed-files
- id: changed-files-yaml
uses: tj-actions/changed-files@v44
with:
files: |
.github/actions/setup-build/action.yml
.github/workflows/build.yml
./**/*.rs
./**/*.toml
./**/*.ts
./**/*.svelte
./package.json
files_yaml: |
src:
- '**/*.rs'
- '**/Cargo.toml'
- '**/*.ts'
- '**/*.svelte'
- 'package.json'
build-server:
needs: check-src
name: build-server
test:
needs: changed-files
name: test-on-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Setup
if: needs.check-src.outputs.status
uses: ./.github/actions/setup-build
if: ${{ needs.changed-files.outputs.src == 'true' }}
- uses: ./.github/actions/setup-build
with:
os: ${{ matrix.os }}

- name: install dependencies (ubuntu only)
if: needs.check-src.outputs.status && matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev librsvg2-dev
- name: Sync node version and setup cache
if: needs.check-src.outputs.status
uses: actions/setup-node@v4
if: ${{ needs.changed-files.outputs.src == 'true' }}
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: package-lock.json

- name: build server
if: needs.check-src.outputs.status
run: |
if: ${{ needs.changed-files.outputs.src == 'true' }}
- run: |
python3 build.py build
python3 build.py lint
if: ${{ needs.changed-files.outputs.src == 'true' }}
auto-merge:
needs:
- test
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
if: ${{ always() && !cancelled() && !failure() && github.actor == 'dependabot[bot]' }}
steps:
- run: gh pr merge --auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
46 changes: 13 additions & 33 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@ jobs:
name: check-license
steps:
- uses: actions/checkout@v4
- name: Sync node version and setup cache
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: install frontend dependencies
run: |
npm install
- name: Check license
run: |
- run: npm install
- run: |
git submodule update --init tools/autd3-license-check
cd tools/license-checker
cargo run
Expand All @@ -31,29 +27,24 @@ jobs:
name: create-github-release
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
- id: create_release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: false
- name: Output Release URL File
run: |
- run: |
echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
echo "${{ steps.create_release.outputs.id }}" > release_id.txt
- name: Save Release URL File for publish
uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v1
with:
name: release_url
path: release_url.txt
- name: Save Release URL File for publish
uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v1
with:
name: release_id
path: release_id.txt


publish-server:
name: publish-server-${{ matrix.os }}
needs: [release]
Expand All @@ -63,37 +54,26 @@ jobs:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Setup
uses: ./.github/actions/setup-build
- uses: ./.github/actions/setup-build
with:
os: ${{ matrix.os }}

- name: install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-latest'
- if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev librsvg2-dev
- name: Sync node version and setup cache
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: build
run: |
python3 build.py build --external-only
- name: Load Release ID File from release job
uses: actions/download-artifact@v1
- run: python3 build.py build --external-only
- uses: actions/download-artifact@v1
with:
name: release_id
- name: Get Release File Name & Upload URL
id: get_release_info
- id: get_release_info
uses: juliangruber/read-file-action@v1
with:
path: ./release_id/release_id.txt
Expand Down
Loading

0 comments on commit 62facf9

Please sign in to comment.