Skip to content

Commit e73eba6

Browse files
committed
ci: Greenlight MELPA releases after successfully publishing binaries
1 parent 2b845a7 commit e73eba6

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

.github/workflows/bump-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Bump version
2020
run: script/dev bump-version
2121

22-
# This will not trigger workflows, because it doesn't use a personal access token.
22+
# We don't want this to trigger workflows, so we don't use a personal access token.
2323
- name: Create the release commit
2424
# TODO: Sign the tag?
2525
run: |

.github/workflows/release.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ jobs:
8181
- uses: actions/checkout@v2
8282
- name: Generate release notes
8383
run: |
84-
script/dev release-notes "$(git describe --tags --abbrev=0)" > RELEASE-NOTES
84+
RELEASE_VERSION=$(git describe --tags --abbrev=0)
85+
script/dev release-notes "$RELEASE_VERSION" > RELEASE-NOTES
86+
echo RELEASE_VERSION=$RELEASE_VERSION >> $GITHUB_ENV
8587
cat RELEASE-NOTES
8688
8789
- name: Download binaries
@@ -96,3 +98,21 @@ jobs:
9698
body_path: RELEASE-NOTES
9799
files: |
98100
tree-sitter-grammars-*.tar.gz
101+
102+
- name: Greenlight releasing to MELPA
103+
run: |
104+
git push origin ${{ env.RELEASE_VERSION }}:refs/heads/release
105+
continue-on-error: true
106+
107+
# We don't want this to trigger workflows, so we don't use a personal access token.
108+
- name: Greenlight releasing to MELPA Stable
109+
uses: actions/github-script@v4
110+
with:
111+
script: |
112+
github.git.createRef({
113+
owner: context.repo.owner,
114+
repo: context.repo.repo,
115+
ref: "refs/tags/melpa-stable/v${{ env.RELEASE_VERSION }}",
116+
sha: context.sha
117+
})
118+
continue-on-error: true

0 commit comments

Comments
 (0)