Skip to content

Conversation

claytonrcarter
Copy link
Collaborator

@claytonrcarter claytonrcarter commented Feb 6, 2022

This saves .xcarchive build artifacts, which include the prebuilt binaries for each CI run. This is my first time using Github Actions, so any pointers or advice are very welcome. After downloading and extracting, GitX.app is located at GitX.xcarhive/Products/Applications/GitX.app

This is based on:

(The latter 2 based @hannesa2's comment in #240 (comment))

I followed UTMs lead and zipped the .xcarchive in CI, which I assume is just easier/faster for CI to deal with. However, when downloading artifacts, it zips them again, so the downloaded file is a zip that contains a zip that itself contains the GitX.xcarchive dir/package. We could skip the tar/zip step in CI, which would result in the download just being a zip that contains the .xcarchive, but I don't know if that would slow down CI or anything for having to deal w/ uploading all of the files individually. Opinions?

These are not "releases", they are just artifacts. As such, they will only be retained for 90 days (the default and max allowed for public repos). If someone wants to take this and run w/ it to make it more of a nightly release mechanism, please have at it.

This doesn't fix the local build issues that many of us seem to be having (see #239), but it at least allows us to use whatever black magic is happening in CI to access a recent build.

See #240 #221 #239 and generally any other error w/ a title like "build failure" or "cannot build".

@claytonrcarter claytonrcarter changed the title maybe save build artifacts? ci: save build artifacts Feb 6, 2022
Copy link
Contributor

@hannesa2 hannesa2 left a comment

Choose a reason for hiding this comment

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

Are you satisfied with your saving ?

image

Of course, the best would be a dmg file, but that's maybe a too big task.
Btw, I do my changes on my fork, and when I'm done I create a pull request on upstream to avoid noise for others. Ok, this is not always helping... but I try

xcodebuild -workspace GitX.xcworkspace -scheme GitX -archivePath ./GitX archive
tar -acf GitX.xcarchive.zip GitX.xcarchive
- name: Upload artifacts
uses: actions/upload-artifact@v2
Copy link
Contributor

Choose a reason for hiding this comment

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

What's about to avoid size by skipping failed jobs ?

https://github.com/hannesa2/mediapipe/blob/APK-0.8.2/.github/workflows/CI.yml#L44
I mean similar with
if: ${{ success() }}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, I had assumed that, if the build failed, follow up jobs would be cancelled. This is nice and clear, though.

@hannesa2
Copy link
Contributor

hannesa2 commented Feb 6, 2022

To be honest, I'm not that familiar with the archived file, and I was not able to use.
How to use it ?

When you write, that you can use your generated artifacts, I will merge it immediate

@claytonrcarter
Copy link
Collaborator Author

claytonrcarter commented Feb 6, 2022 via email

@claytonrcarter
Copy link
Collaborator Author

Ok, the latest version includes the if suggestion and doesn't upload the .xcarchive, just the GitX.app. If all goes well, the artifacts for d/l will be a zip that extracts just a runnable GitX.app. 🤞

Regarding all of the artifacts: if each build uses the same artifact name, then we will end up w/ only a single artifact from whatever build completed last. (Each one will be overwritten.)

Another option would be to do something like ${{ matrix.xcode }} == Xcode_13.2.1 (or similar) to only upload the artifact from a specific Xcode version.

@claytonrcarter
Copy link
Collaborator Author

and doesn't upload the .xcarchive, just the GitX.app. If all goes well, the artifacts for d/l will be a zip that extracts just a runnable GitX.app. 🤞

I was wrong. There is something about the .xcarchive that makes the .app work. The latest push is "working" but I agree that it's not great. I'll keep playing w/ it to see if I can come up w/ something more friendly.

@stepheneb
Copy link
Contributor

fyi: I was able to generate an archive in my fork using this pull request, download and unzip the archive and then pull a working app out of GitX.xcarchive//Products/Applications/GitX.app

@hannesa2
Copy link
Contributor

hannesa2 commented Feb 7, 2022

I merge it and when you have a beeter solution

I was wrong. There is something about the .xcarchive that makes the .app work. The latest push is "working" but I agree that it's not great. I'll keep playing w/ it to see if I can come up w/ something more friendly.

Fine, I will merge it and when you have a better solution : please share with us

@hannesa2
Copy link
Contributor

hannesa2 commented Feb 7, 2022

And Sorry about the spam!

No problem, I will squash all

@hannesa2 hannesa2 merged commit a46b96d into gitx:master Feb 7, 2022
@claytonrcarter
Copy link
Collaborator Author

I just opened #256, which updates CI to upload a dmg instead of an xcarchive.

@claytonrcarter claytonrcarter deleted the ci-artifacts branch February 7, 2022 16:37
@hannesa2 hannesa2 added the breaking-change breaking-change label Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change breaking-change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants