9
9
# ## - WE SHOULD KEEP IN SYNC THE URL OF THE RELEASE ###
10
10
# ##################################################################################################
11
11
12
-
13
12
name : Publish Scala to Chocolatey
14
13
run-name : Publish Scala ${{ inputs.version }} to Chocolatey
15
14
@@ -33,10 +32,47 @@ jobs:
33
32
build :
34
33
runs-on : windows-latest
35
34
steps :
36
- - run : echo hello world # TODO: ACTUALLY BUILD THE .nupkg
35
+ - name : Check the version of Chocolatey
36
+ run : choco --version
37
+ - name : Replace the version placeholder
38
+ uses : richardrigutins/replace-in-files@v2
39
+ with :
40
+ files : ./pkgs/chocolatey/scala.nuspec
41
+ search-text : ' @LAUNCHER_VERSION@'
42
+ replacement-text : ${{ inputs.version }}
43
+ - name : Replace the URL placeholder
44
+ uses : richardrigutins/replace-in-files@v2
45
+ with :
46
+ files : ./pkgs/chocolatey/tools/chocolateyinstall.ps1
47
+ search-text : ' @LAUNCHER_URL@'
48
+ replacement-text : ${{ env.RELEASE-URL }}/${{ env.MSI_FILE }}
49
+ - name : Build the Chocolatey package (.nupkg)
50
+ run : choco --pack ./pkgs/chocolatey/scala.nuspec --outputdirectory ./pkgs/chocolatey
51
+ - name : Upload the Chocolatey package to GitHub
52
+ uses : actions/upload-artifact@v4
53
+ with :
54
+ name : scala.nupkg
55
+ path : ./pkgs/chocolatey/scala.nupkg
56
+ if-no-files-found : error
37
57
38
- publish :
58
+ test :
39
59
runs-on : windows-latest
40
60
needs : build
41
61
steps :
42
- - run : echo hello world # TODO: ACTUALLY PUBLISH THE PACKAGE
62
+ - name : Fetch the Chocolatey package from GitHub
63
+ uses : actions/download-artifact@v4
64
+ with :
65
+ name : scala.nupkg
66
+ - name : Try to install the package locally
67
+ run : choco install scala --debug --verbose --source .
68
+
69
+ publish :
70
+ runs-on : windows-latest
71
+ needs : [build, test]
72
+ steps :
73
+ - name : Fetch the Chocolatey package from GitHub
74
+ uses : actions/download-artifact@v4
75
+ with :
76
+ name : scala.nupkg
77
+ - name : Publish the package to Chocolatey
78
+ run : choco push scala.nupkg --source https://push.chocolatey.org/ --api-key ${{ secrets.API-KEY }}
0 commit comments