-
Notifications
You must be signed in to change notification settings - Fork 101
122 lines (101 loc) · 3.34 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
117
118
119
120
121
name: Release, IntelliJ-Haxe-plugin
on:
push:
tags:
- "release-[0-9]+.[0-9]+.[0-9]+**" # trigger on tags that matches version numbers ex. 1.3.10
jobs:
prepare:
name: Create release draft
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
id: ${{ steps.create_release.outputs.id }}
steps:
- uses: actions/checkout@v3
- name: shorten Changelog
id: shortlog
run: |
sed -b -e '/^\r\?$/,$d' CHANGELOG.md >> shortlog.txt
- name: read Changelog
id: changelog
uses: juliangruber/read-file-action@v1
with:
path: ./shortlog.txt
- name: Get short SHA
id: short_sha
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.changelog.outputs.content }}
draft: true
prerelease: false
build:
name: Build and upload artifacts
strategy:
fail-fast: true # cancel all builds if one fails.
matrix:
IDEA_VERSION: [ 2023.2 ]
needs: prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
architecture: x64
- name: Set up Haxe
uses: krdlab/setup-haxe@v1
with:
haxe-version: 4.3.0
- name: Test haxe
run: haxe -version
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Cache intelliJ downloads
uses: actions/cache@v3
with:
path: $GITHUB_WORKSPACE/idea
key: ${{ matrix.IDEA_VERSION }}-idea-${{ hashFiles('ideaIU-${{ matrix.IDEA_VERSION }}/**') }}
restore-keys: ${{ matrix.IDEA_VERSION }}-idea
- name: Build with Gradle
run: ./gradlew clean test buildPlugin verifyPlugin
- name: Find assets
id: find_assets
run: |
ARTIFACT_PATHNAME=$(ls *.zip | head -n 1)
ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME)
echo artifact_name=${ARTIFACT_NAME} >> $GITHUB_OUTPUT
echo artifact_pathname=${ARTIFACT_PATHNAME} >> $GITHUB_OUTPUT
- name: Upload Asset
id: upload-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.prepare.outputs.upload_url }}
asset_path: ${{ steps.find_assets.outputs.artifact_pathname }}
asset_name: intellij-haxe-${{ matrix.IDEA_VERSION }}.zip
asset_content_type: application/java-archive
finish:
name: publish release
needs: [prepare, build]
runs-on: ubuntu-latest
steps:
- name: Publish release
uses: StuYarrow/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
id: ${{ needs.prepare.outputs.id }}