-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (101 loc) · 3.03 KB
/
build.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
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
103
104
name: Build
on:
pull_request:
types: ["opened", "synchronize"]
branches:
- main
push:
branches:
- main
env:
node-version: 15.x
ruby-version: head
python-version: 3.x
jobs:
install:
name: Install
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.node-version }}
- name: Use Python ${{ env.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.python-version }}
- name: Use Ruby ${{ env.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby-version }}
- name: Install dotfiles
run: ./script/install.sh -Bd
env:
DOTFILES_HOME: ${{ github.workspace }}
tag:
name: Tag
runs-on: ubuntu-latest
if: |
!contains(github.event.head_commit.message, '[ci skip]') &&
github.ref == 'refs/heads/main' &&
github.event_name == 'push'
needs: install
outputs:
tag: ${{ steps.next-tag.outputs.tag }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get previous tag
id: previous-tag
run: echo "::set-output name=tag::$(git describe --abbrev=0)"
- name: Get next tag
id: next-tag
run: echo "::set-output name=tag::$(./script/ci/next-tag.sh)"
- name: Create and push tag
id: tag
uses: mathieudutour/github-tag-action@v5.5
with:
custom_tag: ${{ steps.next-tag.outputs.tag }}
tag_prefix: ""
github_token: ${{ secrets.GITHUB_TOKEN }}
release:
name: Release
runs-on: ubuntu-latest
if: |
!contains(github.event.head_commit.message, '[ci skip]') &&
github.ref == 'refs/heads/main' &&
github.event_name == 'push'
needs: tag
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: recursive
- name: Generate changelog
id: changelog
uses: nuuday/github-changelog-action@master
with:
tag: ${{ needs.tag.outputs.tag }}
config_dir: script/ci/.release-notes
filename: ""
- name: Generate asset
run: tar -zcf /tmp/dotfiles-${{ needs.tag.outputs.tag }}.tar.gz --exclude-vcs -C $DOTFILES_HOME/.. $(basename $DOTFILES_HOME) --transform "s/$(basename $DOTFILES_HOME)/.dotfiles/"
env:
DOTFILES_HOME: ${{ github.workspace }}
- name: Release
uses: softprops/action-gh-release@v0.1.8
with:
tag_name: ${{ needs.tag.outputs.tag }}
body: ${{ steps.changelog.outputs.changelog }}
files: /tmp/dotfiles-*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}