Skip to content

Commit cde656c

Browse files
authored
Merge pull request #3645 from ActiveState/version/0-47-1-RC1
Version 0.47.1-RC1
2 parents abb5937 + 156b56b commit cde656c

File tree

19 files changed

+107
-15
lines changed

19 files changed

+107
-15
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,16 @@ jobs:
8181
- # === Install State Tool ===
8282
name: Install State Tool
8383
uses: ActiveState/setup-state-tool@v1
84+
if: runner.os != 'Windows'
85+
86+
- # === Install State Tool (Windows) ===
87+
name: Install State Tool (Windows)
88+
if: runner.os == 'Windows'
89+
shell: pwsh
90+
run: |
91+
Invoke-Expression -Command ".\installers\install.ps1 -n"
92+
echo "$env:LOCALAPPDATA\ActiveState\StateTool\release\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
93+
Invoke-Expression "$env:LOCALAPPDATA\ActiveState\StateTool\release\bin\state config set optin.unstable true"
8494
8595
- # === Setup ===
8696
name: Setup
@@ -262,7 +272,7 @@ jobs:
262272

263273
- # === Configure AWS credentials ==
264274
name: Configure AWS credentials
265-
uses: aws-actions/configure-aws-credentials@v2
275+
uses: aws-actions/configure-aws-credentials@v4
266276
with:
267277
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
268278
role-session-name: ${{ env.AWS_ROLE_SESSION_NAME }}
@@ -482,7 +492,7 @@ jobs:
482492

483493
- # === Configure AWS credentials ==
484494
name: Configure AWS credentials
485-
uses: aws-actions/configure-aws-credentials@v2
495+
uses: aws-actions/configure-aws-credentials@v4
486496
with:
487497
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
488498
role-session-name: ${{ env.AWS_ROLE_SESSION_NAME }}

activestate.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ scripts:
8181
- name: install-deps-ci
8282
language: bash
8383
standalone: true
84-
if: ne .Shell "cmd"
8584
value: |
8685
if { [[ "$GOOS" == "windows" ]] || [[ "$OS" == "Windows_NT" ]]; } && ! type "goversioninfo" &> /dev/null; then
8786
echo "goversioninfo was not found on your PATH. Installing .."

cmd/state/internal/cmdtree/checkout.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ func newCheckoutCommand(prime *primer.Values) *captain.Command {
2626
Description: locale.Tl("flag_state_checkout_runtime-path_description", "Path to store the runtime files"),
2727
Value: &params.RuntimePath,
2828
},
29+
{
30+
Name: "portable",
31+
Description: locale.Tl("flag_state_checkout_portable_description", "Copy files to their runtime path instead of linking to them"),
32+
Value: &params.Portable,
33+
},
2934
{
3035
Name: "no-clone",
3136
Description: locale.Tl("flag_state_checkout_no_clone_description", "Do not clone the github repository associated with this project (if any)"),

installers/install.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function setShellOverride
154154
$currentPid = $PID
155155
while ($currentPid -ne 0)
156156
{
157-
$process = Get-WmiObject Win32_Process | Where-Object { $_.ProcessId -eq $currentPid }
157+
$process = Get-CimInstance Win32_Process | Where-Object { $_.ProcessId -eq $currentPid }
158158
if (!$process) { break }
159159

160160
if ($process.Name -eq "cmd" -or $process.Name -eq "cmd.exe")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# It is recommended that you do not commit this file as it contains configuration that is specific to your machine
22
cache: {{ .Cache }}
3+
portable: {{ .Portable }}

internal/runbits/checkout/checkout.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func New(repo git.Repository, prime primeable) *Checkout {
5252
return &Checkout{repo, prime}
5353
}
5454

55-
func (r *Checkout) Run(ns *project.Namespaced, branchName, cachePath, targetPath string, noClone, bareCheckout bool) (_ string, rerr error) {
55+
func (r *Checkout) Run(ns *project.Namespaced, branchName, cachePath, targetPath string, noClone, bareCheckout, portable bool) (_ string, rerr error) {
5656
defer r.rationalizeError(&rerr)
5757

5858
path, err := r.pathToUse(ns, targetPath)
@@ -94,7 +94,7 @@ func (r *Checkout) Run(ns *project.Namespaced, branchName, cachePath, targetPath
9494
return "", errNoCommitID
9595
}
9696

97-
if err := CreateProjectFiles(path, cachePath, owner, proj, branchName, commitID.String(), language); err != nil {
97+
if err := CreateProjectFiles(path, cachePath, owner, proj, branchName, commitID.String(), language, portable); err != nil {
9898
return "", errs.Wrap(err, "Could not create project files")
9999
}
100100

@@ -182,7 +182,7 @@ func (r *Checkout) fetchProject(
182182
return owner, proj, commitID, branchName, language, pj.RepoURL, nil
183183
}
184184

185-
func CreateProjectFiles(checkoutPath, cachePath, owner, name, branch, commitID, language string) error {
185+
func CreateProjectFiles(checkoutPath, cachePath, owner, name, branch, commitID, language string, portable bool) error {
186186
configFile := filepath.Join(checkoutPath, constants.ConfigFileName)
187187
if !fileutils.FileExists(configFile) {
188188
_, err := projectfile.Create(&projectfile.CreateParams{
@@ -192,6 +192,7 @@ func CreateProjectFiles(checkoutPath, cachePath, owner, name, branch, commitID,
192192
Directory: checkoutPath,
193193
Language: language,
194194
Cache: cachePath,
195+
Portable: portable,
195196
})
196197
if err != nil {
197198
if osutils.IsAccessDeniedError(err) {

internal/runbits/runtime/runtime.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ func Update(
252252
if opts.Archive != nil {
253253
rtOpts = append(rtOpts, runtime.WithArchive(opts.Archive.Dir, opts.Archive.PlatformID, checkout.ArtifactExt))
254254
}
255+
if proj.IsPortable() {
256+
rtOpts = append(rtOpts, runtime.WithPortable())
257+
}
255258

256259
if err := rt.Update(buildPlan, rtHash, rtOpts...); err != nil {
257260
return nil, locale.WrapError(err, "err_packages_update_runtime_install")

internal/runners/activate/activate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (r *Activate) Run(params *ActivateParams) (rerr error) {
9595
}
9696

9797
// Perform fresh checkout
98-
pathToUse, err := r.activateCheckout.Run(params.Namespace, params.Branch, "", params.PreferredPath, false, false)
98+
pathToUse, err := r.activateCheckout.Run(params.Namespace, params.Branch, "", params.PreferredPath, false, false, false)
9999
if err != nil {
100100
return locale.WrapError(err, "err_activate_pathtouse", "Could not figure out what path to use.")
101101
}

internal/runners/checkout/checkout.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type Params struct {
3838
RuntimePath string
3939
NoClone bool
4040
Force bool
41+
Portable bool
4142
}
4243

4344
type primeable interface {
@@ -121,7 +122,7 @@ func (u *Checkout) Run(params *Params) (rerr error) {
121122

122123
u.out.Notice(locale.Tr("checking_out", ns.String()))
123124

124-
projectDir, err := u.checkout.Run(ns, params.Branch, params.RuntimePath, params.PreferredPath, params.NoClone, archive != nil)
125+
projectDir, err := u.checkout.Run(ns, params.Branch, params.RuntimePath, params.PreferredPath, params.NoClone, archive != nil, params.Portable)
125126
if err != nil {
126127
return errs.Wrap(err, "Checkout failed")
127128
}

internal/runners/deploy/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func (d *Deploy) install(params *Params, commitID strfmt.UUID) (rerr error) {
168168

169169
if err := checkout.CreateProjectFiles(
170170
params.Path, params.Path, params.Namespace.Owner, params.Namespace.Project,
171-
constants.DefaultBranchName, commitID.String(), "",
171+
constants.DefaultBranchName, commitID.String(), "", true,
172172
); err != nil {
173173
return errs.Wrap(err, "Could not create project files")
174174
}

0 commit comments

Comments
 (0)