-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (48 loc) · 1.84 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Deploy
on:
release:
types: [published]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repo
uses: actions/checkout@28c7f3d2b5162b5ddd3dfd9a45aa55eaf396478b # v2.3.1
with:
submodules: true
- name: Get version tag of release
run: |
tag=$( node ./.github/bin/get-version-tag ${{ github.ref }} )
echo "Tag: ${tag}"
echo "VERSION_TAG=$tag" >> $GITHUB_ENV
- name: Install apm (with Atom)
env:
TEMP_DEB: atom-amd64.deb
run: |
wget -nv -O "$TEMP_DEB" https://atom.io/download/deb &&
sudo apt -qq install "./$TEMP_DEB"
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 }}
run: |
apm publish --tag "$VERSION_TAG"
- name: Delete tag on failure
if: failure()
run: |
git push origin :${{ github.ref }}
echo "The GitHub release has been relegated to a draft and can be republished when the problems are fixed"