-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (83 loc) · 2.43 KB
/
publish.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
name: Build, Release & Publish
on: push
jobs:
build:
name: Checkout & Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup haxe
uses: krdlab/setup-haxe@v1
with:
haxe-version: 4.2.5
- uses: danielo515/stylua-action@1.0.1
name: Setup stylua so we can run it on build
with:
token: ${{ secrets.github_token }}
version: 0.16.0
- name: Run haxe tests
run: |
haxelib install --always libs.hxml
haxe test-macro.hxml
haxe tests.hxml
- name: Build
run: |
haxe build.hxml
- name: Clone neodev
uses: actions/checkout@v3
with:
repository: folke/neodev.nvim.git
path: /home/runner/.config/.haxe/nvim-api
- name: Generate API
run: |
haxe build-api.hxml
- name: Run test that should fail
run: |
./run-fail-test.sh
- name: Ensure lua code output doesn't change
uses: tj-actions/verify-changed-files@v13
id: changedfiles
with:
files: |
lua/danielo_nvim
- name: Fail if there are changed files (should not be the case)
if: steps.changedfiles.outputs.files_changed == 'true'
run: |
echo "Changed files: ${{ steps.changedfiles.outputs.changed_files }}"
git --no-pager diff "${{ steps.changedfiles.outputs.changed_files }}"
exit 1
release:
name: Check version & Create release
permissions:
contents: write # to create release commit
pull-requests: write # to create release PR
runs-on: ubuntu-latest
needs: build
outputs:
# expose release.outputs.released for the "publish" job
released: ${{ steps.release.outputs.release_created }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
command: manifest
publish:
name: Publish to Haxelib
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.released
steps:
- uses: actions/checkout@v3
- uses: krdlab/setup-haxe@v1
with:
haxe-version: 4.2.5
- run: |
haxe -version
haxelib --debug submit . "$HAXELIB_PASSWORD"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HAXELIB_PASSWORD: ${{ secrets.HAXELIB_PASSWORD }}