-
Notifications
You must be signed in to change notification settings - Fork 4
138 lines (136 loc) · 6.74 KB
/
publish-release.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
name: Publish releases for IDeSyDe
on:
release:
types: [created]
jobs:
publish-on-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: get_version
uses: battila7/get-version-action@v2
- name: Build everything
run: |
sudo apt-get update
sudo apt-get install -y curl bash build-essential libssl-dev pkg-config mingw-w64 musl-dev musl-tools dos2unix
cd ${{ github.workspace }}
# for whatever reason, for the moment nothing seems to work except an extreme manual approach.
# this should be corrected later when misterious external errors stop happening
wget -c https://github.com/Jabba-Team/jabba/releases/download/0.13.0/jabba-0.13.0-linux-amd64 -O ./jabba-linux-amd64
chmod +x jabba-linux-amd64
./jabba-linux-amd64 install ${{ matrix.jdk }} -o /opt/jdk
export JAVA_HOME=/opt/jdk
export PATH=$PATH:$JAVA_HOME/bin
dos2unix ./gradlew # make sure that gradlew is not with CRLF
curl -fL "https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux-static.gz" | gzip -d > cs
chmod +x ./cs
./cs setup --yes
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y
rustup target add x86_64-unknown-linux-gnu
cargo build --release --target x86_64-unknown-linux-gnu
./scripts/make-all-linux.sh
# - name: Upload windows binaries to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: "${{ github.workspace }}/dist/idesyde-${{ steps.get_version.outputs.version }}-x86_64-pc-windows-gnu.zip"
# asset_name: idesyde-${{ steps.get_version.outputs.version }}-x86_64-windows.zip
# tag: "${{ github.ref }}"
# overwrite: true
- name: Upload linux binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "${{ github.workspace }}/idesyde-x86_64-unknown-linux-gnu.zip"
asset_name: idesyde-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-gnu.zip
tag: "${{ github.ref }}"
overwrite: true
- name: Make MUSL
run: |
rustup target add x86_64-unknown-linux-musl
cargo build --release --target x86_64-unknown-linux-musl
./scripts/make-all-linux-musl.sh
- name: Upload linux MUSL binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "${{ github.workspace }}/idesyde-x86_64-unknown-linux-musl.zip"
asset_name: idesyde-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-musl.zip
tag: "${{ github.ref }}"
overwrite: true
publish-on-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- id: get_version
uses: battila7/get-version-action@v2
- name: Build everything
run: |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-Expression (Invoke-WebRequest https://github.com/Jabba-Team/jabba/raw/main/install.ps1 -UseBasicParsing).Content
Invoke-WebRequest -Uri "https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe" -OutFile "rustup-init.exe"
.\rustup-init.exe -y
Invoke-WebRequest -Uri "https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-win32.zip" -OutFile "cs-x86_64-pc-win32.zip"
Expand-Archive -Path "cs-x86_64-pc-win32.zip"
Rename-Item -Path "cs-x86_64-pc-win32.exe" -NewName "cs.exe"
Remove-Item -Path "cs-x86_64-pc-win32.zip"
.\cs setup --yes
cd ${{ github.workspace }}
jabba install amazon-corretto@17
jabba alias default amazon-corretto@17
cargo build --release --target x86_64-pc-windows-msvc
.\scripts\make-all-windows.ps1
# - name: Upload windows binaries to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: "${{ github.workspace }}/dist/idesyde-${{ steps.get_version.outputs.version }}-x86_64-pc-windows-gnu.zip"
# asset_name: idesyde-${{ steps.get_version.outputs.version }}-x86_64-windows.zip
# tag: "${{ github.ref }}"
# overwrite: true
- name: Upload linux binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "${{ github.workspace }}/idesyde-x86_64-pc-windows-msvc.zip"
asset_name: idesyde-${{ steps.get_version.outputs.version }}-x86_64-pc-windows-msvc.zip
tag: "${{ github.ref }}"
overwrite: true
# publish-on-linux-musl:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - id: get_version
# uses: battila7/get-version-action@v2
# - name: Build everything
# run: |
# sudo apt-get update
# sudo apt-get install -y curl bash build-essential libssl-dev pkg-config mingw-w64 musl-dev musl-tools dos2unix
# cd ${{ github.workspace }}
# curl -sL https://github.com/Jabba-Team/jabba/raw/main/install.sh | bash && . ~/.jabba/jabba.sh
# jabba install amazon-corretto@17
# jabba alias default amazon-corretto@17
# dos2unix ./gradlew # make sure that gradlew is not with CRLF
# curl -fL "https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux-static.gz" | gzip -d > cs
# chmod +x ./cs
# ./cs setup --yes
# curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y
# rustup target add x86_64-unknown-linux-musl
# cargo build --release --target x86_64-unknown-linux-musl
# ./scripts/make-all-linux-musl.sh
# # - name: Upload windows binaries to release
# # uses: svenstaro/upload-release-action@v2
# # with:
# # repo_token: ${{ secrets.GITHUB_TOKEN }}
# # file: "${{ github.workspace }}/dist/idesyde-${{ steps.get_version.outputs.version }}-x86_64-pc-windows-gnu.zip"
# # asset_name: idesyde-${{ steps.get_version.outputs.version }}-x86_64-windows.zip
# # tag: "${{ github.ref }}"
# # overwrite: true
# - name: Upload linux binaries to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: "${{ github.workspace }}/idesyde-x86_64-unknown-linux-musl.zip"
# asset_name: idesyde-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-musl.zip
# tag: "${{ github.ref }}"
# overwrite: true