-
Notifications
You must be signed in to change notification settings - Fork 1.1k
132 lines (113 loc) · 5.44 KB
/
releases.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
###################################################################################################
### OFFICIAL RELEASE WORKFLOW ###
### HOW TO USE: ###
### - THIS WORKFLOW WILL NEED TO BE TRIGGERED MANUALLY ###
### ###
### NOTE: ###
### - THIS WORKFLOW SHOULD ONLY BE RUN ON STABLE RELEASES ###
### - IT ASSUMES THAT THE PRE-RELEASE WORKFLOW WAS PREVIOUSLY EXECUTED ###
### ###
###################################################################################################
name: Official release of Scala
run-name: Official release of Scala ${{ inputs.version }}
on:
workflow_dispatch:
inputs:
version:
description: 'The version to officially release'
required: true
type: string
jobs:
republish_artifacts:
permissions:
contents: write # for GH CLI to create a release
runs-on: [self-hosted, Linux]
container:
image: lampepfl/dotty:2024-10-18
options: --cpu-shares 4096
volumes:
- ${{ github.workspace }}/../../cache/sbt:/root/.sbt
- ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache
- ${{ github.workspace }}/../../cache/general:/root/.cache
env:
RELEASEBUILD: yes
steps:
######################################################################################
## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA IS DISTRIBUTED USING JAVA 8. ##
######################################################################################
- name: Set JDK 8 as default
run: echo "/usr/lib/jvm/java-8-openjdk-amd64/bin" >> $GITHUB_PATH
- name: Reset existing repo
run: |
git config --global --add safe.directory /__w/scala3/scala3
git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true
- name: Checkout cleanup script
uses: actions/checkout@v4
- name: Cleanup
run: .github/workflows/cleanup.sh
- name: Git Checkout
uses: actions/checkout@v4
- name: Add SBT proxy repositories
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true
- name: Check compiler version
shell: bash
run : |
version=$(./project/scripts/sbt "print scala3-compiler-bootstrapped/version" | tail -n1)
echo "This build version: ${version}"
if [ "${version}" != "${{ inputs.version }}" ]; then
echo "Compiler version for this build '${version}', does not match tag: ${{ inputs.version }}"
exit 1
fi
- name: Prepare the SDKs
shell: bash
run : |
git config --global --add safe.directory /__w/scala3/scala3
prepareSDK() {
distroSuffix="$1"
sbtProject="$2"
distDir="$3"
# Build binaries
./project/scripts/sbt "all ${sbtProject}/Universal/packageBin ${sbtProject}/Universal/packageZipTarball"
artifactName="scala3-${{ inputs.version }}${distroSuffix}"
zipArchive="${artifactName}.zip"
tarGzArchive="${artifactName}.tar.gz"
# Caluclate SHA for each of archive files
for file in "${zipArchive}" "${tarGzArchive}"; do
mv ${distDir}/target/universal/$file $file
sha256sum "${file}" > "${file}.sha256"
done
}
prepareSDK "" "dist" "./dist/"
prepareSDK "-aarch64-pc-linux" "dist-linux-aarch64" "./dist/linux-aarch64/"
prepareSDK "-x86_64-pc-linux" "dist-linux-x86_64" "./dist/linux-x86_64/"
prepareSDK "-aarch64-apple-darwin" "dist-mac-aarch64" "./dist/mac-aarch64/"
prepareSDK "-x86_64-apple-darwin" "dist-mac-x86_64" "./dist/mac-x86_64/"
prepareSDK "-x86_64-pc-win32" "dist-win-x86_64" "./dist/win-x86_64/"
# - name: Download MSI package
# uses: actions/download-artifact@v4
# with:
# name: scala.msi
# path: .
# - name: Prepare MSI package
# shell: bash
# run: |
# msiInstaller="scala3-${{ inputs.version }}.msi"
# mv scala.msi "${msiInstaller}"
# sha256sum "${msiInstaller}" > "${msiInstaller}.sha256"
- name: Install GH CLI
uses: dev-hanz-ops/[email protected]
with:
gh-cli-version: 2.59.0
# Create the GitHub release
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
shell: bash
run: |
git config --global --add safe.directory /__w/scala3/scala3
gh release upload ${{ inputs.version }} \
--clobber \
scala3-${{ inputs.version }}*.zip \
scala3-${{ inputs.version }}*.tar.gz \
scala3-${{ inputs.version }}*.sha256
# scala3-${{ inputs.version }}.msi