From 55973ed04fa1e492c80327d6dee17b5e83578eb9 Mon Sep 17 00:00:00 2001 From: Simon Steinbeiss Date: Wed, 6 Jul 2022 15:23:17 +0200 Subject: [PATCH] ci: Build a release tarball (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: build the tarball and keep the archive accessible in the associated GitHub Action. --- .github/workflows/symlinks.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/symlinks.yml b/.github/workflows/symlinks.yml index c58fac5f9..234e91605 100644 --- a/.github/workflows/symlinks.yml +++ b/.github/workflows/symlinks.yml @@ -16,3 +16,32 @@ jobs: sudo apt install -y libgtk-3-dev --no-install-recommends ./configure make test + - name: Build png theme + shell: bash + run: | + sudo apt install -y libgtk-3-dev optipng --no-install-recommends + ./configure + make + cd build + tar -cf elementary-xfce.tar.gz * + - name: Upload theme artifact + if: ${{ github.event_name == 'push' }} + uses: actions/upload-artifact@v3 + with: + name: elementary-xfce + path: build/elementary-xfce.tar.gz + - name: Get artifact link + shell: bash + run: | + echo 'ARTIFACT_URL=$(curl -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts | grep \"url\"' >> $GITHUB_ENV + - 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: "Here's a link to the artifact: ${{ env.ARTIFACT_URL }}" + })