forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
57 lines (52 loc) · 2.22 KB
/
build-chocolatey.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
###################################################################################################
### THIS IS A REUSABLE WORKFLOW TO BUILD SCALA WITH CHOCOLATEY ###
### HOW TO USE: ###
### ###
### NOTE: ###
### ###
###################################################################################################
name: Build 'scala' Chocolatey Package
run-name: Build 'scala' (${{ inputs.version }}) Chocolatey Package
on:
workflow_call:
inputs:
version:
required: true
type : string
url:
required: true
type : string
digest:
required: true
type : string
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Replace the version placeholder
uses: richardrigutins/replace-in-files@v2
with:
files: ./pkgs/chocolatey/scala.nuspec
search-text: '@LAUNCHER_VERSION@'
replacement-text: ${{ inputs.version }}
- name: Replace the URL placeholder
uses: richardrigutins/replace-in-files@v2
with:
files: ./pkgs/chocolatey/tools/chocolateyInstall.ps1
search-text: '@LAUNCHER_URL@'
replacement-text: ${{ inputs.url }}
- name: Replace the CHECKSUM placeholder
uses: richardrigutins/replace-in-files@v2
with:
files: ./pkgs/chocolatey/tools/chocolateyInstall.ps1
search-text: '@LAUNCHER_SHA256@'
replacement-text: ${{ inputs.digest }}
- name: Build the Chocolatey package (.nupkg)
run: choco pack ./pkgs/chocolatey/scala.nuspec --out ./pkgs/chocolatey
- name: Upload the Chocolatey package to GitHub
uses: actions/upload-artifact@v4
with:
name: scala.nupkg
path: ./pkgs/chocolatey/scala.${{ inputs.version }}.nupkg
if-no-files-found: error