From 98964709950180153cf46c5b56fd85a0908a38c7 Mon Sep 17 00:00:00 2001 From: BirdZhang <0312birdzhang@gmail.com> Date: Mon, 7 Sep 2020 16:51:02 +0800 Subject: [PATCH] Create build.yml --- .github/workflows/build.yml | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..0295b19 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,59 @@ +name: SouniaoIME + +on: + push: + branches: + - master + tags: + - '*' + pull_request: + branches: + - master + +env: + RELEASE: 3.3.0.14 + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Prepare + run: mkdir output + + - name: Build armv7hl + run: docker run --rm --privileged -v $PWD:/share coderus/sailfishos-platform-sdk:$RELEASE /bin/bash -c " + mkdir -p build ; + cd build ; + cp -r /share/* . ; + mb2 -t SailfishOS-$RELEASE-armv7hl build ; + sudo cp -r RPMS/*.rpm /share/output" + + - name: Build i486 + run: docker run --rm --privileged -v $PWD:/share coderus/sailfishos-platform-sdk:$RELEASE /bin/bash -c " + mkdir -p build ; + cd build ; + cp -r /share/* . ; + mb2 -t SailfishOS-$RELEASE-i486 build ; + sudo cp -r RPMS/*.rpm /share/output" + + - name: Upload build result + uses: actions/upload-artifact@v2 + with: + name: screencast-rpms + path: output + + - name: Create release + if: contains(github.ref, 'release') + run: | + set -x + assets=() + for asset in output/*.rpm; do + assets+=("-a" "$asset") + done + tag_name="${GITHUB_REF##*/}" + hub release create "${assets[@]}" -m "$tag_name" "$tag_name" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}