Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use github action to publish snap #6063

Merged
merged 2 commits into from
Mar 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,18 @@ jobs:
- name: Build snap (1) Setup snapcraft
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to run this in parallel as it's own job?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently does not work at all: https://github.com/JabRef/jabref/actions/runs/49715346

cannot read snap file "build/distribution/jabref*.snap"

Trying to debug.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also very difficult to do it in parallel in a separate workflow (which is not what you meant, right?). IMHO it depends on the steps above (including jpackage, ...). Thus, we would need to duplicate 100 SLOC of the build file.

We could work with different jobs in the same build file. Then, we would need to introduce uploading the build directory (more?) to GitHub as data passing between jobs can only be done that way. This is not comfortable (we have to be sure that we don't forget something)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot read is because the * is not expanded. Fixed it in cd70746

uses: jhenstridge/snapcraft-build-action@v1
id: snapcraft
if: matrix.displayName == 'linux'
if: matrix.displayName == 'linux' && github.ref == 'refs/heads/master'
- name: Build snap (2) Run build
run: |
mv ${{ steps.snapcraft.outputs.snap }} build/distribution/
if: matrix.displayName == 'linux'
if: matrix.displayName == 'linux' && github.ref == 'refs/heads/master'
- name: Build snap (3) Upload snap
uses: jhenstridge/snapcraft-publish-action@v1
with:
store_login: ${{ secrets.SNAPCRAFT_LOGIN_FILE }}
snap: build/distribution/jabref*.snap
release: edge
if: matrix.displayName == 'linux' && github.ref == 'refs/heads/master'
env:
SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }}
run: |
mkdir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg
snapcraft push build/distribution/jabref*.snap --release edge || true
shell: bash
- name: Rename files
run: |
get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "${{ steps.gitversion.outputs.AssemblySemVer }}","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"}
Expand Down