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

Automatically deploy PKGBUILD to AUR #54

Closed
alexander-bauer opened this issue Jun 1, 2017 · 22 comments
Closed

Automatically deploy PKGBUILD to AUR #54

alexander-bauer opened this issue Jun 1, 2017 · 22 comments

Comments

@alexander-bauer
Copy link
Contributor

The AUR accepts package updates via Git, so updating an AUR package is as simple as pushing a git repository to their server. This repository must have the PKGBUILD at its root, however. One way I think we can accomplish this is to extract the dist/arch/ directory as a subtree on-the-fly, and push that to the AUR as one step in a continuous deployment pipeline. If the subtree is extracted in the same way every time, it will keep the same history, with just the commits relevant to that directory, regardless of when or where it is generated.

Doing this would mean collaborating with @jtojnar, who owns the package on the AUR.

@jtojnar
Copy link
Contributor

jtojnar commented Jun 1, 2017

I think the most reasonable would be creating a new AUR account and adding it as co-maintainer. Then adding the following script into deploy section of .travis.yml.

git clone ssh://aur@aur.archlinux.org/tectonic.git staging/arch
cp dist/arch/PKGBUILD staging/arch
cd staging/arch
mksrcinfo
git add PKGBUILD .SRCINFO
git commit -m "Release $TRAVIS_TAG"
git push origin master

For generating .SRCINFO we can either use makepkg or probably easier pkgbuild-introspection (only depends on bash).

We would also need to add a private key for deploying. This looks like another area where Travis is not optimal but we could always try to store it in an environment variable and then save it to a proper file in the script.

@pkgw
Copy link
Collaborator

pkgw commented Jun 2, 2017

I will leave it to you two (and other Arch Linux users) to think about how you'd like to do this.

Am I understanding correctly that in this model, every push to master would result in an update of the AUR git repo and a new version appearing on the AUR? Is that standard practice? If it is also common to only push updates for new tagged upstream releases, I might prefer that model — life as a maintainer is a bit easier if your users aren't running ever-changing unreleased versions of the package.

@jtojnar
Copy link
Contributor

jtojnar commented Jun 2, 2017

In AUR, there are two kinds of packages: Normal packages that get updated when a new version is tagged, and VCS packages that always fetch the current HEAD and need to be updated only when dependencies change. The tectonic package is the former one, since it lacks -git suffix.

Travis allows you to mark deploy scenarios to run only when a tag is added, see conditional releases.

@alexander-bauer
Copy link
Contributor Author

@jtojnar It looks like the way to accomplish deployment with Travis will be to store the ssh key in the repository, but keep it encrypted with Travis's file encrypting capabilities. We'll have to collaborate with @pkgw to generate a "deploy" keypair, and to store the encrypted one in the repository with the Travis key. After that, we can create an AUR user as a co-maintainer and install the deploy public key.

@pkgw
Copy link
Collaborator

pkgw commented Jun 2, 2017

OK, I am happy to generate a keypair and get an encrypted private key into .travis.yml if you can outline any unusual settings for the SSH keys and what bits need to go into the Travis file.

@alexander-bauer
Copy link
Contributor Author

@pkgw If you are willing, I think these are the steps that you'll need to do, as someone with Travis access:

  1. Generate a standard ssh keypair without a password using ssh-keygen and put the results where in the repository (I suggest dist/deploy_key, but you may want a separate directory)
  2. Check in the public key (dist/deploy_key.pub), but not the private one (dist/deploy_key)
  3. Install and log into the Travis CLI client gem install travis && travis login
  4. Encrypt the secret key, adding the associated command to the Travis file: travis encrypt-file dist/deploy_key --add
  5. Add the resulting dist/deploy_key.enc and changes to .travis.yml to the repository

Afterward, if you're so inclined, you can remove or shred the unencrypted private key. Once this public key is available, @jtojnar and I can collaborate to figure out the rest.

@pkgw
Copy link
Collaborator

pkgw commented Jun 4, 2017

OK. CC #65. I think that I had to monkey with the file path in the .travis.yml (its suggested change named the file as just deploy_key not dist/deploy_key) but wanted to put it through a CI run to double-check that.

@alexander-bauer
Copy link
Contributor Author

With the key now extant (thanks @pkgw!), I think the next step is to create an automated tectonic-deploy user on the AUR with that public key installed. It would be much nicer to add the key directly to the AUR repository as a deploy key, like GitHub does, but the AUR doesn't have that feature.

I've gone ahead and created this user (tectonic-deploy), and think the following steps are next:

  1. Change the email address to one associated with the Tectonic project, if one exists. Otherwise, I can keep hold of it.
  2. Add it as a co-maintainer on the AUR project. This will require @jtojnar's doing.
  3. Add the deploy step of the Travis build.

@jtojnar
Copy link
Contributor

jtojnar commented Jun 4, 2017

I added the user as co-maintainer, will try to create the deploy script later.

jtojnar pushed a commit to jtojnar/tectonic that referenced this issue Jun 4, 2017
This uses Travis’s automatic deploy feature – everytime a new version
is tagged, the PKGBUILD file, along with updated metadata will be
uploaded to AUR.

Closes: tectonic-typesetting#54
jtojnar added a commit to jtojnar/tectonic that referenced this issue Jun 4, 2017
This uses Travis’s automatic deploy feature. Everytime a new version
is tagged, the PKGBUILD file along with updated metadata will be
uploaded to AUR.

Decrypting the private key was moved to the `before_deploy` stage,
to limit the possibility of the key leaking.

Closes: tectonic-typesetting#54
@pkgw
Copy link
Collaborator

pkgw commented Jun 5, 2017

@alexander-bauer For the time being, I guess you can/should keep the account associated with your email address. If more of these accounts need to be created I guess I will make a GMail account for the project leadership — this is also something that comes up in the Code of Conduct.

@pkgw pkgw closed this as completed in #67 Jun 5, 2017
@pkgw
Copy link
Collaborator

pkgw commented Jul 8, 2017

It seems as if the autodeploy didn't quite work: see the Travis build log.

@pkgw pkgw reopened this Jul 8, 2017
@alexander-bauer
Copy link
Contributor Author

alexander-bauer commented Jul 8, 2017 via email

@jtojnar
Copy link
Contributor

jtojnar commented Jul 8, 2017

I do not see why a branch would not be checked out. Cloning it locally chooses master.

On a side note, I switched my Arch machine to NixOS so AUR packaging is no longer a priority for me. I can transfer the ownership to you, if you wish.

@pkgw
Copy link
Collaborator

pkgw commented Jul 9, 2017

I think I might want to tag another release shortly to update the Documentation link on crates.io. So if anyone has a chance to try to solve this in the near future, there can be a chance to test the fix :-)

@alexander-bauer
Copy link
Contributor Author

alexander-bauer commented Jul 9, 2017 via email

@jtojnar
Copy link
Contributor

jtojnar commented Jul 11, 2017

@alexander-bauer I transferred the package to you.

@pkgw
Copy link
Collaborator

pkgw commented Sep 29, 2018

Hello, folks that have previously been interested in packaging Tectonic on Arch Linux! It's been a while — apologies for not being super attentive to this aspect of things.

I put out a 0.1.10 release today, and I decided to spend a bit of time trying to figure out the status of automatic deployment to the AUR. There were definitely a few problems. I've fixed some of the more superficial ones, but it's still not quite working.

Here's the latest build log. As far as I can tell, the SSH key that we're trying to use to deploy just isn't working. Would that have changed in the past year or so?

Edit: and in case they come in handy, here's the current deploy script and here's the relevant piece of the .travis.yml that also does some stuff.

@pkgw
Copy link
Collaborator

pkgw commented Sep 30, 2018

@jtojnar Looking at the AUR page, perhaps the problem is that the tectonic-deploy user is not a co-maintainer? Are you able to alter that?

I realized that the past few releases wouldn't have worked anyway because I wasn't updating the PKGBUILD file — I didn't realize it needed maintenance. I will try to keep it updated going forward.

@jtojnar
Copy link
Contributor

jtojnar commented Sep 30, 2018

@pkgw I do not see a link for managing co-maintainers any more, perhaps @polyzen needs to do it.

@polyzen
Copy link
Contributor

polyzen commented Sep 30, 2018

Edit: and in case they come in handy, here's the current deploy script and here's the relevant piece of the .travis.yml that also does some stuff.

Seems it would be better to use mksrcinfo available in the pkgbuild-introspection package. Save some bandwidth, at least.

@pkgw I do not see a link for managing co-maintainers any more, perhaps @polyzen needs to do it.

Done, and you are also now (again :p) the maintainer of the package. Tried to switch myself to a co-maintainer, but something went wrong there. I will just send a PR or something if need be. :)

@jtojnar
Copy link
Contributor

jtojnar commented Sep 30, 2018

@polyzen I do not use Arch any more, so I transferred it back to you.

@pkgw
Copy link
Collaborator

pkgw commented Sep 30, 2018

It worked! Thanks all for assisting.

@polyzen It appears the pkgbuild-introspection has been removed — see the comment at the bottom of its package page. That's why I switched away from it.

@pkgw pkgw closed this as completed Sep 30, 2018
Mrmaxmeier pushed a commit to Mrmaxmeier/tectonic that referenced this issue Oct 1, 2019
references for `pdf_rect`, `pdf_tmatrix`, `transform_info`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants