From c7162bb3410bcf3ab3b3ab0f5dfc7d8c975b1943 Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Tue, 30 Jun 2020 14:41:48 +0100 Subject: [PATCH 1/4] GH Actions: Replace symlink cylc.json with hard copy on release Because apm doesn't pull submodules --- .github/workflows/deploy.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 49c186a..1e90517 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -30,6 +30,21 @@ jobs: rm -f "$TEMP_DEB" apm --version + - name: Prepare grammar file & push updated release # Has to be before Publish step + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git checkout -b "latest-release" + cp --remove-destination ./cylc-textmate-grammar/cylc.tmLanguage.json ./grammars/cylc.json + echo "grammars/cylc.json symlink updated to hard copy" + + git commit -a -m "CI release" -m "Workflow: ${{ github.workflow }}, run: ${{ github.run_number }}" + + git push -f origin latest-release + # Update tag on origin to this commit: + git push -f origin HEAD:${{ github.ref }} + - name: Publish env: ATOM_ACCESS_TOKEN: ${{ secrets.ATOM_TOKEN }} From d44da47752e41c268e32307aef167b3b6d043fb6 Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Tue, 30 Jun 2020 14:43:42 +0100 Subject: [PATCH 2/4] Prepare v1.0.1 --- CHANGELOG.md | 8 +++++++- package.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efd89f3..eff0f5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,8 @@ +## 1.0.1 + +### Bug fixes +- Package actually works now + ## 1.0.0 -Initial release + +### Initial release diff --git a/package.json b/package.json index edcc8dc..894e6c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "language-cylc", - "version": "1.0.0", + "version": "1.0.1", "description": "Atom language package for Cylc workflow configuration files", "repository": "https://github.com/cylc/language-cylc", "license": "GPL-3.0", From 5c8f643daaa23bd1202e3536c0b487508b934f5c Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Tue, 30 Jun 2020 15:00:45 +0100 Subject: [PATCH 3/4] Update the contributing section of README --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8ebc8dd..3cc54b5 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,7 @@ Please report any syntax highlighting issues at [cylc/cylc-textmate-grammar](htt This repo includes the [cylc/cylc-textmate-grammar](https://github.com/cylc/cylc-textmate-grammar) repo as a git submodule. If you don't have experience with submodules, you should [read the docs](https://git-scm.com/book/en/v2/Git-Tools-Submodules) first. -The cylc-textmate-grammar repo contains a JSON TextMate grammar file which is used by Atom for syntax highlighting (symlinked to by `/grammars/cylc.json`). Read the [Atom guide on creating a TextMate grammar](https://flight-manual.atom.io/hacking-atom/sections/creating-a-legacy-textmate-grammar/) for more information. **Note:** do not edit the JSON file when contributing; instead you should edit the JavaScript grammar file and build it, as explained in the [contributing](https://github.com/cylc/cylc-textmate-grammar#contributing) section of cylc-texmate-grammar. Any edits will be part of that repo as opposed to this repo. - -On the other hand, any contributions to Atom-specific features are to be made in this repo, not the submodule. +The cylc-textmate-grammar repo contains a JSON TextMate grammar file which is used by Atom for syntax highlighting (symlinked to by `grammars/cylc.json`). Read the [Atom guide on creating a TextMate grammar](https://flight-manual.atom.io/hacking-atom/sections/creating-a-legacy-textmate-grammar/) for more information. **Note:** do not edit the JSON file when contributing; instead you should edit the JavaScript grammar file and build it, as explained in the [contributing](https://github.com/cylc/cylc-textmate-grammar#contributing) section of cylc-texmate-grammar. Any edits will be part of that repo as opposed to this repo. To install a development copy of the package: ``` @@ -44,5 +42,11 @@ git clone --recurse-submodules https://github.com/cylc/language-cylc.git cd language-cylc apm link --dev ``` -The `--recurse-submodules` option automatically initialises the cylc-textmate-grammar submodule. `apm link --dev` symlinks the clone to `~/.atom/dev/` so that it is loaded when you run Atom in dev mode. +The `--recurse-submodules` option automatically initialises the cylc-textmate-grammar submodule. `apm link --dev` symlinks the clone to `~/.atom/dev/` so that it is loaded when you run Atom in dev mode: +``` +atom --dev . +``` + +You can then edit the `cylc-textmate-grammar/src/cylc.tmLanguage.js` grammar file. First, [read the contributing section](https://github.com/cylc/cylc-textmate-grammar#contributing) of the cylc-textmate-grammar repo - any such edits will be part of that repo as opposed to this vscode-cylc repo. Remember to run `npm build` inside `cylc-texmate-grammar` after editing & saving the file. Reload the dev window using Ctrl+Shift+F5. +Contributions to Atom-specific features are to be made in this repo, not the submodule. From 4d1925728be08e3aa3f419bacbbd54f461b2c976 Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Tue, 30 Jun 2020 15:12:04 +0100 Subject: [PATCH 4/4] Update owners.md --- owners.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/owners.md b/owners.md index b88dad0..8cdd6ca 100644 --- a/owners.md +++ b/owners.md @@ -5,13 +5,16 @@ ## Deploying -Publishing updates to the Atom package registry is done automatically by GitHub Actions when a release is published. The suggested workflow is: +Publishing updates to the Atom package registry is done automatically by GitHub Actions when a release is published. The suggested process is: 1. Merge the pull request(s) with changes -1. Bump the `package.json` version, and create a PR (1 reviewer is fine) +1. Bump the `package.json` version, update the changelog and create a PR (1 reviewer is fine) 1. Publish a release on GitHub with a tag matching the version number If the Deploy workflow fails because you forgot to bump the `package.json` version, the tag associated with the release will be automatically deleted and the release will become a draft. Simply bump the `package.json` version as appropriate and re-publish the release to trigger the workflow again. + ### Information on publishing Atom packages Publishing is done by `apm`. See https://flight-manual.atom.io/behind-atom/sections/maintaining-your-packages/. The Atom token of a member of the Cylc organization (gotten from signing in at [atom.io](https://atom.io)) needs to be [stored as a repository secret](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets). The token of any member of the organization (with push access) will do. + +The Deploy workflow also replaces the symlink `grammars/cylc.json` with a hard copy of `cylc-textmate-grammar/cylc.tmLanguage.json` in a tag that dangles off master, because `apm` doesn't pull submodules - see [#3](https://github.com/cylc/language-cylc/pull/3).