diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..0599c5f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,73 @@ +name: Build and Upload Artifacts + +on: + push: + branches: + - master + - 'ci-*' + - 'stable*' + pull_request: + branches: + - master + - 'ci-*' + - 'stable*' + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-22.04, macos-13] + include: + - os: ubuntu-22.04 + env: CC=gcc-5 CXX=g++-5 + - os: macos-13 + osx_image: xcode13.2 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up dependencies (Linux) + if: runner.os == 'Linux' + run: | + sudo apt update + sudo apt install -y \ + autoconf automake build-essential clang cmake execstack fakeroot \ + g++-5 git libc-ares-dev libctemplate-dev libcurl4-openssl-dev \ + libglib2.0-dev libgnome-keyring-dev libicu-dev libsasl2-dev \ + libsasl2-modules libsasl2-modules-gssapi-mit libsecret-1-dev \ + libssl-dev libnss3=2:3.28.4-0ubuntu0.16.04.14 libnss3-dev \ + libtidy-dev libtool libxext-dev libxkbfile-dev libxml2-dev \ + libxtst-dev rpm uuid-dev xvfb + + - name: Start Xvfb for Linux + if: runner.os == 'Linux' + run: | + if [[ "$RUNNER_OS" == "Linux" ]]; then + Xvfb :99 & export DISPLAY=:99.0 + fi + + - name: Create directories + run: | + mkdir -p ../app + mkdir -p ../app/dist + + - name: Run build script + run: ./build.sh + + - name: Upload artifact (Linux/macOS) + if: success() + uses: actions/upload-artifact@v3 + with: + name: mailsync-${GITHUB_SHA:0:8}-${{ runner.os }} + path: ../app/dist/mailsync.tar.gz + + - name: Cache build dependencies + uses: actions/cache@v3 + with: + path: /tmp/mailsync-build-deps-v2 + key: ${{ runner.os }}-mailsync-deps-${{ hashFiles('**/build.sh') }} + restore-keys: | + ${{ runner.os }}-mailsync-deps- diff --git a/.travis.yml b/.travis.yml index a6a3ec2..d0e8ddb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,8 +59,6 @@ matrix: - os: linux env: CC=gcc-5 CXX=g++-5 dist: xenial - - os: osx - osx_image: xcode13.2 before_script: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then Xvfb :99 & export DISPLAY=:99.0; fi