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

Add GH action to compile and upload .dat file #51

Merged
merged 1 commit into from
Aug 1, 2024
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
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
workflow_dispatch:
inputs:
tagname:
description: Release Tag Name
required: true
type: string

env:
ACEVER: 0.9.34

jobs:
run:
runs-on: ubuntu-latest
env:
ACEFILE: "ace-${{ env.ACEVER }}-x86-64.tar.gz"
OUTFILE: "erg-${{ inputs.tagname }}-x86-64-$ACEVER.dat"

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.tagname }}

- name: Install ACE
run: |
wget "http://sweaglesw.org/linguistics/ace/download/$ACEFILE"
Copy link
Member

Choose a reason for hiding this comment

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

Can we get the files from https://github.com/delph-in/ace? Maybe we can make a release there and use it until better automation in the Ace deploy too.

Copy link
Member Author

Choose a reason for hiding this comment

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

What is the benefit of using the GitHub mirror over Woodley's server?

Copy link
Member

Choose a reason for hiding this comment

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

  1. a more stable link to download. We had problems in the past with Woodley's server being down
  2. a push for DELPH-IN adoption of Git/GitHub
  3. some automation on subsequent releases of Ace (via GitHub actions)
  4. an easier experience for a newcomer showing better integration of the DELPH-IN ecosystem

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for explaining. Some responses:

  1. Some of those problems were user error, like using https instead of http. His server has been fairly reliable in my experience, and I'm not too worried about having to re-run a job because the server happened to be down.
  2. Maybe, but I don't think many people would notice this down in a CI script. And I'd say that sweaglesw.org is still the "official" home of ACE, so I don't know if it makes sense to promote the GitHub repo unless that changes.
  3. I would like to see an action to compile ACE on its GitHub repo, but we would still need to update this script to take advantage of future versions.
  4. Not sure I see how using the GitHub ACE over the sweaglesw ACE achieves the easier experience for a newcomer.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@goodmami, I expected to see the Action that you added in the list of Actions on https://github.com/delph-in/erg, but don't yet, so I guess it will appear once you commit your addition to main, yes? The script looks like it will indeed do what I hope for, thanks. Your call to compile the grammar is the same as what I do. I don't think you should have to do anything to retrieve the redwoods.mem file, since I marked it to always be included for download. (I know this costs more in Github data transfer than it would to store that file in some other repository somewhere, but if that starts to get expensive, we can revisit the setup.)

As for ACE, I think it remains best to get it from the place where Woodley maintains it, namely sweagles. If he ever gets won over to using Github, we can adjust, but I agree that sweagles has been pretty reliable over time.

Copy link
Member Author

Choose a reason for hiding this comment

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

@danflick thanks for the feedback. And, yes, the action should appear once this is merged.

The lack of visibility until it's merged makes testing a bit difficult. I was able to use https://github.com/nektos/act/ to test out most steps of this action locally, but I haven't tested the final step that uploads it as a release asset, so we may need to fix something after merging.

Copy link
Member

Choose a reason for hiding this comment

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

I didn't know about this nektosact.com, thank you for sharing!

tar xf "$ACEFILE"
./ace-$ACEVER/ace -V

- name: Compile Grammar
run: |
./ace-$ACEVER/ace -g ace/config.tdl -G "$OUTFILE"
bzip2 "$OUTFILE"

- name: Upload Release Asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "${{ inputs.tagname }}" "$OUTFILE".bz2