Repository navigation
132 lines (106 loc) · 4.18 KB
/
Copy pathrelease.yml
File metadata and controls
132 lines (106 loc) · 4.18 KB
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
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release
jobs:
ubuntu:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v7
- name: Use Node.js 22
uses: actions/setup-node@v7
with:
node-version: 22
- name: Check and set Rust version
run: ./scripts/check_rust_version.sh
- name: Build alan app
run: make
- name: Generate Alan tar.gz
run: cd ./avm/target/release && tar -czf /tmp/alan-ubuntu.tar.gz alan
- name: Upload Alan tar.gz
uses: svenstaro/upload-release-action@2.11.5
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: /tmp/alan-ubuntu.tar.gz
asset_name: alan-ubuntu.tar.gz
- name: Generate Alan Debian package
run: |
sudo apt install checkinstall -y
alanversion=$(echo ${{github.ref}} | sed "s/refs\/tags\/v//")
echo "Alan Programming Language Compiler and Runtime\n\n" | sudo checkinstall --install=no -D --pkgversion=${alanversion} --pkglicense=MIT --maintainer=hello@alantechnologies.com --pkggroup="Alan Technologies, Inc" --nodoc --deldesc=yes --delspec=yes --backup=no
cp ./alan_${alanversion}-1_amd64.deb /tmp/alan_amd64.deb
- name: Upload Alan Debian package
uses: svenstaro/upload-release-action@2.11.5
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: /tmp/alan_amd64.deb
asset_name: alan_amd64.deb
windows:
runs-on: windows-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v7
- name: Use Node.js 22
uses: actions/setup-node@v7
with:
node-version: 22
- name: Check and set Rust version
run: pwsh -File ./scripts/check_rust_version.ps1
# The AVM requires openssl dev files to build now, and apparently the rust openssl code can auto-acquire it through vcpkg, so set that up
- name: Set up vcpkg
run: |
git clone https://github.com/microsoft/vcpkg
cd vcpkg && bootstrap-vcpkg.bat && vcpkg integrate install && vcpkg install openssl --triplet x64-windows-static-md
- name: Build alan app
run: make
- name: Generate Alan zip
run: Compress-Archive -Path "$(Join-Path (Get-Location).Path '\\avm\\target\\release\\alan.exe')" -DestinationPath "$(Join-Path (Get-Location).Path 'alan-windows.zip')"
- name: Upload Alan zip
uses: svenstaro/upload-release-action@2.11.5
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ./alan-windows.zip
asset_name: alan-windows.zip
macos:
runs-on: macos-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v7
- name: Use Node.js 22
uses: actions/setup-node@v7
with:
node-version: 22
- name: Check and set Rust version
run: ./scripts/check_rust_version.sh
- name: Build alan app
run: make
- name: Generate Alan tar.gz
run: |
brew install gnu-tar
cd ./avm/target/release && gtar -czf /tmp/alan-macos.tar.gz alan
- name: Upload Alan tar.gz
uses: svenstaro/upload-release-action@2.11.5
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: /tmp/alan-macos.tar.gz
asset_name: alan-macos.tar.gz
- name: Update homebrew
run: |
alanversion=$(echo ${{github.ref}} | sed "s/refs\/tags\///")
[[ $alanversion != *'beta'* ]] && \
curl \
--fail \
-XPOST \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" \
-H "authorization: token ${{secrets.AUTOPUBLISH}}" \
https://api.github.com/repos/alantech/homebrew-core/actions/workflows/update.yml/dispatches \
-d '{"ref": "main", "inputs": {"alan_version": "'"$alanversion"'"}}' \
|| echo "Prerelease. Do not update homebrew"