Skip to content

Commit

Permalink
Fix Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
graphemecluster committed Jan 9, 2024
1 parent 9b800cc commit ddc1f0b
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 77 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build CI

on:
push:
pull_request:

jobs:
linux:
uses: ./.github/workflows/linux-build.yml

macos:
uses: ./.github/workflows/macos-build.yml
with:
build_variant: ${{ startsWith(github.ref, 'refs/tags/') && '-universal' || '' }}

windows:
uses: ./.github/workflows/windows-build.yml

release:
needs: [macos, windows]
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') && success() }}
steps:
- name: Download artifacts
uses: actions/download-artifact@v3

- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
name: "librime for TypeDuck: ${{ github.ref_name }}"
files: |
artifact/*
19 changes: 0 additions & 19 deletions .github/workflows/commit-ci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
compiler: [g++, clang]
steps:
- name: Checkout last commit
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
submodules: recursive
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@ jobs:
RIME_PLUGINS: ${{ inputs.rime_plugins }}
steps:
- name: Checkout last commit
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
submodules: recursive

- name: Configure build environment
run: |
echo git_ref_name="$(git describe --always)" >> $GITHUB_ENV
- name: Configure build variant
if: contains(inputs.build_variant, '-universal')
run: |
Expand Down Expand Up @@ -82,15 +78,15 @@ jobs:
- name: Create distributable
run: |
make xcode/dist
tar -cjvf rime-TypeDuck-${{ env.git_ref_name }}-${{ runner.os }}.tar.bz2 \
tar -cjvf rime-TypeDuck-${{ github.ref_name }}-${{ runner.os }}.tar.bz2 \
dist version-info.txt
tar -cjvf rime-deps-TypeDuck-${{ env.git_ref_name }}-${{ runner.os }}.tar.bz2 \
tar -cjvf rime-deps-TypeDuck-${{ github.ref_name }}-${{ runner.os }}.tar.bz2 \
--exclude '*/.placeholder' \
bin include lib share
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: |
rime-TypeDuck-${{ env.git_ref_name }}-${{ runner.os }}.tar.bz2
rime-deps-TypeDuck-${{ env.git_ref_name }}-${{ runner.os }}.tar.bz2
rime-TypeDuck-${{ github.ref_name }}-${{ runner.os }}.tar.bz2
rime-deps-TypeDuck-${{ github.ref_name }}-${{ runner.os }}.tar.bz2
39 changes: 0 additions & 39 deletions .github/workflows/release-ci.yml

This file was deleted.

11 changes: 5 additions & 6 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ jobs:
RIME_PLUGINS: ${{ inputs.rime_plugins }}
steps:
- name: Checkout last commit
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository }}
submodules: recursive

- name: Configure build environment
run: |
copy env.vs2022.bat env.bat
echo git_ref_name="$(git describe --always)" >> $env:GITHUB_ENV
- name: Cache Boost
id: cache-boost
Expand Down Expand Up @@ -74,14 +73,14 @@ jobs:

- name: Create distributable
run: |
7z a rime-TypeDuck-${{ env.git_ref_name }}-${{ runner.os }}.7z `
7z a rime-TypeDuck-${{ github.ref_name }}-${{ runner.os }}.7z `
dist version-info.txt
7z a -x'!*/.placeholder' rime-deps-TypeDuck-${{ env.git_ref_name }}-${{ runner.os }}.7z `
7z a -x'!*/.placeholder' rime-deps-TypeDuck-${{ github.ref_name }}-${{ runner.os }}.7z `
bin include lib share
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: |
rime-TypeDuck-${{ env.git_ref_name }}-${{ runner.os }}.7z
rime-deps-TypeDuck-${{ env.git_ref_name }}-${{ runner.os }}.7z
rime-TypeDuck-${{ github.ref_name }}-${{ runner.os }}.7z
rime-deps-TypeDuck-${{ github.ref_name }}-${{ runner.os }}.7z
2 changes: 1 addition & 1 deletion action-install-plugins-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
export RIME_ROOT="$(cd "$(dirname "$0")"; pwd)"

echo "RIME_PLUGINS=${RIME_PLUGINS}" > version-info.txt
echo "librime $(git describe --always)" >> version-info.txt
echo "librime ${GITHUB_REF_NAME}" >> version-info.txt

function action_install_plugin() {
local plugin="$1"
Expand Down
3 changes: 1 addition & 2 deletions action-install-plugins-windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ set clone_options=^
--no-single-branch

echo RIME_PLUGINS=%RIME_PLUGINS% > version-info.txt
echo librime >> version-info.txt
git describe --always >> version-info.txt
echo librime %GITHUB_REF_NAME% >> version-info.txt

if defined RIME_PLUGINS (
for %%s in (%RIME_PLUGINS%) do call :install_plugin %%s || exit /b
Expand Down

0 comments on commit ddc1f0b

Please sign in to comment.