forked from kkharji/sqlite.lua
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (99 loc) · 3.46 KB
/
release.yml
File metadata and controls
102 lines (99 loc) · 3.46 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Create Release
on:
push:
tags: "v*"
jobs:
release:
# if: github.event.base_ref == 'refs/heads/master'
runs-on: ubuntu-20.04
container:
image: golang:1.16
steps:
-
name: Check out a copy of the repo
uses: actions/checkout@v2
with: { fetch-depth: 0 }
-
run: date +%F > todays-date
-
name: Restore cache for today's nightly.
uses: actions/cache@v2
with:
path: _neovim
key: ${{ runner.os }}-${{ matrix.url }}-${{ hashFiles('todays-date') }}
-
name: Show Tag
id: tag
run: echo ::set-output name=TAG::${GITHUB_REF##*/}
-
name: Setup Git-Chglog and sudo
run: |
apt-get update -y
apt-get install sudo zip unzip build-essential libreadline-dev -y
go get github.com/git-chglog/git-chglog/cmd/git-chglog
-
name: Setup Lua
uses: leafo/gh-actions-lua@v8.0.0
-
name: Setup Luarocks
uses: leafo/gh-actions-luarocks@v4
-
name: Setup Environment
run: |
test -d _neovim || {
mkdir -p _neovim
curl -sL https://github.com/neovim/neovim/releases/download/nightly/nvim-linux64.tar.gz | tar xzf - --strip-components=1 -C "${PWD}/_neovim"
}
mkdir -p ~/.local/share/nvim/site/pack/vendor/start
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start
luarocks install dkjson
-
name: Generate changelog
run: |
sed -i "s/CIGTAG/${{ steps.tag.outputs.TAG }}/g" .github/chglog/CHANGELOG.release.md
$(go env GOPATH)/bin/git-chglog \
-c .github/chglog/config.yml \
-t .github/chglog/CHANGELOG.release.md \
-o RELEASE_CHANGELOG.md ${{ steps.tag.outputs.TAG }}
cat RELEASE_CHANGELOG.md
-
name: Generate Luarocks
run: |
export GTAG=${{ steps.tag.outputs.TAG }}
export PATH="${PWD}/_neovim/bin:${PATH}"
export VIM="${PWD}/_neovim/share/nvim/runtime"
nvim --version
make gen_luarock
ls
-
name: Update version in files
run: |
sed -i '/sqlite\.db\.__version/s/".*"/"${{ steps.tag.outputs.TAG }}"/' ./lua/sqlite/db.lua
git add ./lua/sqlite/db.lua
-
name: Upload to luarocks
env:
LUAROCKS_TOKEN: ${{ secrets.LUAROCKS_TOKEN }}
run: |
luarocks upload \
sqlite-${{ steps.tag.outputs.TAG }}-0.rockspec \
--api-key=${LUAROCKS_TOKEN}
-
name: Push Release Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_MSG: |
:bookmark: release ${{ steps.tag.outputs.TAG }}
see https://github.com/${{ github.repository }}/releases/tag/${{ steps.tag.outputs.TAG }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git commit -m "${COMMIT_MSG}"
git push origin HEAD:master
-
name: Create GH Release
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE_CHANGELOG.md