-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (93 loc) · 2.97 KB
/
release.yaml
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
105
106
107
108
109
110
111
112
113
114
115
116
name: release
on:
schedule:
- cron: '0 0 * * *' # midnight UTC
push:
branches:
- release
- trigger-nightly
jobs:
build-release:
name: build-release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
# - os: ubuntu-latest
# target: x86_64-unknown-linux-musl
# - os: ubuntu-16.04
# target: aarch64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
# - os: macos-latest
# target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
# - os: windows-latest
# target: aarch64-pc-windows-msvc
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
profile: minimal
override: true
- if: matrix.target == 'aarch64-unknown-linux-gnu'
run: sudo apt-get install gcc-aarch64-linux-gnu
- name: Build
run: |
cargo build --manifest-path ./crates/lua-analyzer/Cargo.toml --bin lua-analyzer --target ${{ matrix.target }} --release
- name: Package
shell: bash
run: |
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp "target/${{ matrix.target }}/release/lua-analyzer.exe" "lua-analyzer-${{ matrix.target }}.exe"
echo "ASSET=lua-analyzer-${{ matrix.target }}.exe" >> $GITHUB_ENV
else
cp "target/${{ matrix.target }}/release/lua-analyzer" "lua-analyzer"
tar czf lua-analyzer-${{ matrix.target }}.tar.gz lua-analyzer
echo "ASSET=lua-analyzer-${{ matrix.target }}.tar.gz" >> $GITHUB_ENV
fi
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
# upload everything to dist
name: dist
path: ${{ env.ASSET }}
create-release:
name: create-release
runs-on: ubuntu-latest
needs: ['build-release']
steps:
- run: echo "TAG=$(date --iso -u)" >> $GITHUB_ENV
if: github.ref == 'refs/heads/release'
- run: echo "TAG=nightly" >> $GITHUB_ENV
if: github.ref != 'refs/heads/release'
- run: 'echo "TAG: $TAG"'
- name: Make directories
run: mkdir dist
- name: Download artifacts
uses: actions/download-artifact@v2
with:
# download dist to directory named dist
name: dist
path: dist
- name: List downloaded files
run: |
contents=$(find dist -maxdepth 1 | tail -n +2 | paste -sd " ")
echo "CONTENTS=$contents" >> $GITHUB_ENV
echo "${{ env.CONTENTS }}"
- name: Release
uses: meeDamian/github-release@2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
commitish: master
tag: ${{ env.TAG }}
files: ${{ env.CONTENTS }}
allow_override: true
gzip: false