-
Notifications
You must be signed in to change notification settings - Fork 0
/
release-temp.yml
149 lines (143 loc) · 4.46 KB
/
release-temp.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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Release Loom Project
# on:
# schedule:
# # * is a special character in YAML so you have to quote this string
# - cron: '0 0 * * *'
on:
push:
branches:
- release-together
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Checkout loom repository
uses: actions/checkout@v2
with:
repository: openjdk/loom
ref: fibers
path: src
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14-ea
- name: install prerequisites
run: sudo apt-get install libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev libcups2-dev libasound2-dev
- name: Build JDK
run: |
cd src
sh configure
make images
tar -czvf jdk-loom-linux-nightly.tar.gz build/linux-x86_64-server-release/jdk
- name: Upload linux build
uses: actions/upload-artifact@v1
with:
name: artifacts
path: src/jdk-loom-linux-nightly.tar.gz
build-mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Checkout loom repository
uses: actions/checkout@v2
with:
repository: openjdk/loom
ref: fibers
path: src
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14-ea
- name: Install prerequisites
run: |
brew install autoconf
- name: Build JDK
run: |
cd src
sh configure
make images
tar -czvf jdk-loom-macos-nightly.tar.gz build/macosx-x86_64-server-release/jdk
- name: Upload macox build
uses: actions/upload-artifact@v1
with:
name: artifacts
path: src/jdk-loom-macos-nightly.tar.gz
release:
runs-on: ubuntu-latest
needs:
- build-linux
- build-mac
steps:
- name: Download linux build
uses: actions/download-artifact@v1
with:
name: artifacts
- name: Checkout loom repository
uses: actions/checkout@v2
with:
repository: openjdk/loom
ref: fibers
path: src
- name: Check new commits
run: |
echo $(ls)
cd src
latest_release_tag=$(curl -H "Authorization: token $TOKEN" https://api.github.com/repos/psycho-ir/loom-nightly/releases/latest | jq -r '.tag_name')
version=$(git rev-parse --short HEAD)
echo $latest_release_tag
echo $version
if [ "$latest_release_tag" == "$version" ]; then
echo ::set-env name=CONTINUE::NO
else
echo ::set-env name=CONTINUE::YES
fi
- name: Checkout loom repository
if: env.CONTINUE == 'YES'
uses: actions/checkout@v2
with:
repository: openjdk/loom
ref: fibers
path: src
- name: Set version
if: env.CONTINUE == 'YES'
run: |
cd src
VERSION=$(git rev-parse --short HEAD)
echo ::set-env name=VERSION::$VERSION
- name: Create Release
id: create_release
if: env.CONTINUE == 'YES'
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: Nightly Release
draft: false
prerelease: false
- name: Upload Linux Release Asset
if: env.CONTINUE == 'YES'
id: upload-linux-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/jdk-loom-linux-nightly.tar.gz
asset_name: jdk-loom-linux-nightly.tar.gz
asset_content_type: application/gzip
- name: Upload Macos Release Asset
if: env.CONTINUE == 'YES'
id: upload-mac-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/jdk-loom-macos-nightly.tar.gz
asset_name: jdk-loom-macos-nightly.tar.gz
asset_content_type: application/gzip
- name: Finish
run: |
echo 'Build finished successfully'