From c46cd15f16f5c747336204f0487039191c595cf6 Mon Sep 17 00:00:00 2001 From: Simon Steinbeiss Date: Wed, 6 Jul 2022 15:23:17 +0200 Subject: ci: Build a release tarball on PRs (Fixes #312) On a pull request: build the tarball and add a comment to the PR with a link to the resource. On push to master: run the standard symlink check. --- .github/workflows/pull-request.yml | 37 ++++++++++++++++++++++++++++++++++++ .github/workflows/symlinks-check.yml | 21 ++++++++++++++++++++ .github/workflows/symlinks.yml | 18 ------------------ 3 files changed, 58 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/pull-request.yml create mode 100644 .github/workflows/symlinks-check.yml delete mode 100644 .github/workflows/symlinks.yml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 00000000..4ea7d10a --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,37 @@ +name: "Check symlinks and build theme" + +on: pull_request + +jobs: + check: + name: Check for dangling symlinks + runs-on: ubuntu-latest + + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Check symlinks and build theme + shell: bash + run: | + sudo apt install -y libgtk-3-dev optipng --no-install-recommends + ./configure + make test + make + cd build + tar -cf elementary-xfce.tar.gz * + - name: Upload theme artifact + uses: actions/upload-artifact@v3 + with: + name: elementary-xfce + path: build/elementary-xfce.tar.gz + - name: Add comment with link + uses: actions/github-script@v5 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: "Get the theme build from this PR for easy local testing: [elementary-xfce.zip](https://nightly.link/shimmerproject/elementary-xfce/actions/runs/${{ github.run_id }}/elementary-xfce.zip)" + }) diff --git a/.github/workflows/symlinks-check.yml b/.github/workflows/symlinks-check.yml new file mode 100644 index 00000000..a32d5930 --- /dev/null +++ b/.github/workflows/symlinks-check.yml @@ -0,0 +1,21 @@ +name: "Check symlinks" + +on: + push + branches: + - master + +jobs: + check: + name: Check for dangling symlinks + runs-on: ubuntu-latest + + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Check symlinks + shell: bash + run: | + sudo apt install -y libgtk-3-dev --no-install-recommends + ./configure + make test diff --git a/.github/workflows/symlinks.yml b/.github/workflows/symlinks.yml deleted file mode 100644 index c58fac5f..00000000 --- a/.github/workflows/symlinks.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: "Check symlinks" - -on: [pull_request, push] - -jobs: - check: - name: Check for dangling symlinks - runs-on: ubuntu-latest - - steps: - - name: Check out the repo - uses: actions/checkout@v2 - - name: Check symlinks - shell: bash - run: | - sudo apt install -y libgtk-3-dev --no-install-recommends - ./configure - make test -- cgit v1.2.1