build #239
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
workflow_dispatch: | |
jobs: | |
rebuild: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: update cylc-textmate-grammar submodule | |
run: | | |
git submodule status > before | |
git submodule update --remote | |
git submodule status > after | |
echo "Status before update: $(<before)" | |
echo " after update: $(<after)" | |
if cmp -s before after; then | |
echo '::warning::No update available' | |
exit 1 | |
fi | |
- name: configure ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '2.7' | |
- name: install | |
run: gem install plist | |
- name: build | |
run: | | |
ruby build.rb | |
pattern="(<span actions:bind='update-date'>).*(<\/span>)" | |
sed -i -E "s/${pattern}/\1$(date +%Y-%m-%d)\2/" README.md | |
- name: configure git | |
uses: cylc/release-actions/configure-git@v1 | |
- name: commit | |
run: | | |
new_version="$(git -C cylc-textmate-grammar/ rev-parse HEAD)" | |
git commit -a -m "update: ${new_version}" | |
- name: push | |
run: git push |