Skip to content

Commit

Permalink
ci: Build a release tarball (Fixes #312)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ochosi committed Aug 1, 2022
1 parent f358f09 commit c26cc2c
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/symlinks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,36 @@ 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_ACTION_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 }}"
})

0 comments on commit c26cc2c

Please sign in to comment.