Skip to content

Commit 5b39526

Browse files
committed
✨ activate release workflow
1 parent 78ff09f commit 5b39526

3 files changed

Lines changed: 95 additions & 127 deletions

File tree

.github/workflows/release.yml

Lines changed: 93 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,94 @@
1-
# name: Create Release
2-
# on:
3-
# push:
4-
# tags: ["v*"]
5-
# jobs:
6-
# release:
7-
# if: github.event.base_ref == 'refs/heads/master' # not sure, maybe not
8-
# runs-on: ubuntu-20.04
9-
# container:
10-
# image: golang:1.16
11-
# steps:
12-
# -
13-
# name: Check out a copy of the repo
14-
# uses: actions/checkout@v2
15-
# with: { fetch-depth: 0 }
16-
# -
17-
# run: date +%F > todays-date
18-
# -
19-
# name: Restore cache for today's nightly.
20-
# uses: actions/cache@v2
21-
# with:
22-
# path: build
23-
# key: ${{ runner.os }}-appimage-${{ hashFiles('todays-date') }}
24-
# -
25-
# name: Show Tag
26-
# id: tag
27-
# run: echo ::set-output name=TAG::${GITHUB_REF##*/}
28-
# -
29-
# name: Install required utils
30-
# run: |
31-
# apt-get update
32-
# apt-get -y install luarocks
33-
# go get github.com/git-chglog/git-chglog/cmd/git-chglog
34-
# -
35-
# name: Setup Environment
36-
# run: |
37-
# test -d build || {
38-
# mkdir -p build
39-
# wget https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage
40-
# chmod +x nvim.appimage
41-
# ./nvim.appimage --appimage-extract
42-
# mv ./squashfs-root/usr/bin/nvim ./build/nvim
43-
# }
44-
# mkdir -p ~/.local/share/nvim/site/pack/vendor/start
45-
# git clone --depth 1 https://github.com/nvim-lua/plenary.nvim \
46-
# ~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
47-
# ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start
48-
# -
49-
# name: Generate changelog
50-
# run: |
51-
# $(go env GOPATH)/bin/git-chglog \
52-
# -c .github/chglog/config.yml \
53-
# -t .github/chglog/CHANGELOG.release.md \
54-
# -o RELEASE_CHANGELOG.md ${{ steps.tag.outputs.TAG }}
55-
# cat RELEASE_CHANGELOG.md
56-
# -
57-
# name: Generate Luarocks
58-
# run: |
59-
# export GTAG=${{ steps.tag.outputs.TAG }}
60-
# export PATH="${PWD}/build/:${PATH}"
61-
# make genluarock
62-
# -
63-
# name: Update version in files
64-
# run: |
65-
# sed -i '/sqlite\.db\.__version/s/".*"/"${{ steps.tag.outputs.TAG }}"/' ./lua/sqlite/db.lua
66-
# git add ./lua/sqlite/init.lua
67-
# -
68-
# name: Upload to luarocks
69-
# env:
70-
# LUAROCKS_TOKEN: ${{ secrets.LUAROCKS_TOKEN }}
71-
# run: |
72-
# luarocks upload \
73-
# .sqlite-${{ steps.tag.outputs.TAG }}-0.rockspec \
74-
# --api-key=${LUAROCKS_TOKEN}
75-
# -
76-
# name: Push Release Changes
77-
# env:
78-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79-
# COMMIT_MSG: |
80-
# :bookmark: release ${{ steps.tag.outputs.TAG }}
1+
name: Create Release
2+
on:
3+
push:
4+
tags: ["v*"]
815

82-
# see https://github.com/${{ github.repository }}/releases/tag/${{ steps.tag.outputs.TAG }}
83-
# run: |
84-
# git config --global user.name 'github-actions[bot]'
85-
# git config --global user.email 'github-actions[bot]@users.noreply.github.com'
86-
# git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
87-
# git commit -m "${COMMIT_MSG}"
88-
# git push origin HEAD:master
89-
# -
90-
# name: Create GH Release
91-
# uses: softprops/action-gh-release@v1
92-
# with:
93-
# body_path: RELEASE_CHANGELOG.md
6+
jobs:
7+
release:
8+
if: github.event.base_ref == 'refs/heads/master' # not sure, maybe not
9+
runs-on: ubuntu-20.04
10+
container:
11+
image: golang:1.16
12+
steps:
13+
-
14+
name: Check out a copy of the repo
15+
uses: actions/checkout@v2
16+
with: { fetch-depth: 0 }
17+
-
18+
run: date +%F > todays-date
19+
-
20+
name: Restore cache for today's nightly.
21+
uses: actions/cache@v2
22+
with:
23+
path: build
24+
key: ${{ runner.os }}-appimage-${{ hashFiles('todays-date') }}
25+
-
26+
name: Show Tag
27+
id: tag
28+
run: echo ::set-output name=TAG::${GITHUB_REF##*/}
29+
-
30+
name: Install required utils
31+
run: |
32+
apt-get update
33+
apt-get -y install luarocks
34+
go get github.com/git-chglog/git-chglog/cmd/git-chglog
35+
-
36+
name: Setup Environment
37+
run: |
38+
test -d build || {
39+
mkdir -p build
40+
wget https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage
41+
chmod +x nvim.appimage
42+
./nvim.appimage --appimage-extract
43+
mv ./squashfs-root/usr/bin/nvim ./build/nvim
44+
}
45+
mkdir -p ~/.local/share/nvim/site/pack/vendor/start
46+
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim \
47+
~/.local/share/nvim/site/pack/vendor/start/plenary.nvim
48+
ln -s $(pwd) ~/.local/share/nvim/site/pack/vendor/start
49+
-
50+
name: Generate changelog
51+
run: |
52+
$(go env GOPATH)/bin/git-chglog \
53+
-c .github/chglog/config.yml \
54+
-t .github/chglog/CHANGELOG.release.md \
55+
-o RELEASE_CHANGELOG.md ${{ steps.tag.outputs.TAG }}
56+
cat RELEASE_CHANGELOG.md
57+
-
58+
name: Generate Luarocks
59+
run: |
60+
export GTAG=${{ steps.tag.outputs.TAG }}
61+
export PATH="${PWD}/build/:${PATH}"
62+
make genluarock
63+
-
64+
name: Update version in files
65+
run: |
66+
sed -i '/sqlite\.db\.__version/s/".*"/"${{ steps.tag.outputs.TAG }}"/' ./lua/sqlite/db.lua
67+
git add ./lua/sqlite/db.lua
68+
-
69+
name: Upload to luarocks
70+
env:
71+
LUAROCKS_TOKEN: ${{ secrets.LUAROCKS_TOKEN }}
72+
run: |
73+
luarocks upload \
74+
sqlite-${{ steps.tag.outputs.TAG }}-0.rockspec \
75+
--api-key=${LUAROCKS_TOKEN}
76+
-
77+
name: Push Release Changes
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
COMMIT_MSG: |
81+
:bookmark: release ${{ steps.tag.outputs.TAG }}
82+
83+
see https://github.com/${{ github.repository }}/releases/tag/${{ steps.tag.outputs.TAG }}
84+
run: |
85+
git config --global user.name 'github-actions[bot]'
86+
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
87+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
88+
git commit -m "${COMMIT_MSG}"
89+
git push origin HEAD:master
90+
-
91+
name: Create GH Release
92+
uses: softprops/action-gh-release@v1
93+
with:
94+
body_path: RELEASE_CHANGELOG.md

.sqlite-master-0.rockspec

Lines changed: 0 additions & 33 deletions
This file was deleted.

scripts/gen_rockspec.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ build = {
5151
modules = %s
5252
}
5353
54-
]]):format(version, version, dependencies, ins(description), ins(modules))
54+
]]):format(version, ins(description), version, dependencies, ins(modules))
5555

56-
local file_handle = io.open(("%s/.sqlite-%s-0.rockspec"):format(cwd, version), "w")
56+
local file_handle = io.open(("%s/sqlite-%s-0.rockspec"):format(cwd, version), "w")
5757

5858
file_handle:write(output)
5959
file_handle:close()

0 commit comments

Comments
 (0)