Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix support for Windows and macOS #44

Merged
merged 22 commits into from
Sep 26, 2022
Merged

Fix support for Windows and macOS #44

merged 22 commits into from
Sep 26, 2022

Conversation

wilg
Copy link
Contributor

@wilg wilg commented Sep 20, 2022

Should probably be squashed as I was losing my mind implementing this, but this should allow this action to work on Windows and Mac, at least in my testing. It shouldn't break anything on other platforms.

Basically just changing hardcoded paths, converting paths to Windows paths (ugh), and on Windows $USERNAME was getting clobbered.

I removed the hardcoded, duplicate copies to /home/runner/Steam. I don't think they were needed, but I haven't tested this on Linux.

@wilg wilg mentioned this pull request Sep 20, 2022
chmod +x ${{ github.action_path }}/steam_deploy.sh
${{ github.action_path }}/steam_deploy.sh
chmod +x $GITHUB_ACTION_PATH/steam_deploy.sh
$GITHUB_ACTION_PATH/steam_deploy.sh
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary for the path to be Linux-style when running on Windows.

manifest_path=$(pwd)/manifest.vdf
contentroot=$(pwd)/$rootPath
if [[ "$OSTYPE" == "darwin"* ]]; then
steamdir="$HOME/Library/Application Support/Steam"
Copy link
Contributor Author

@wilg wilg Sep 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, seems like a bug in Steam that steamcmd clobbers your main Steam app authentication on macOS.

Copy link
Member

@davidmfinol davidmfinol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +81 to +82
steam_username: ${{ inputs.username }}
steam_password: ${{ inputs.password }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the breaking change?

The action is called steam-deploy. Do the variables really need steam_ in them?

If not absolutely needed I'd prefer to not break for existing users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think it was a breaking change, since these values come from the inputs which haven't changed their name. The reason is it appeared somewhere in the Windows bash environment $username was getting set to empty string, because this is a variable name some shells automatically set to the current user or otherwise reserve.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks for the explanation.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally speaking we should be converting all these "env" to "with" variables. That way they'll be prepended with INPUT_ which effectively solves this category of problem. But out of scope for this issue.

Copy link
Member

@webbertakken webbertakken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me as well.

Can you confirm this works?

You can check it using game-ci/steam-deploy@daec6fc2db6aa5f073e3b1530cd19f6648bb4171

Comment on lines +81 to +82
steam_username: ${{ inputs.username }}
steam_password: ${{ inputs.password }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks for the explanation.

Copy link
Member

@davidmfinol davidmfinol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with my app and it failed: https://github.com/finol-digital/Card-Game-Simulator/actions/runs/3109277871/jobs/5040233833

I think for the linux runner, we really need the "Copying /home/runner/Steam/ssfn...".
@wilg Can you bring that back for linux and I'll test again?

Also, all the logs go to /home/runner/Steam on Linux, so I think we should use that path instead of $steamdir when displaying the errors, as most users have linux runners.

@wilg
Copy link
Contributor Author

wilg commented Sep 24, 2022

Oh interesting. I wonder why that is. I'll investigate and fix when I try to get Linux up and running on my end hopefully sometime soon.

wilg and others added 3 commits September 24, 2022 13:00
Co-authored-by: David Finol <davidmfinol@gmail.com>
steam_deploy.sh Outdated Show resolved Hide resolved
steam_deploy.sh Outdated Show resolved Hide resolved
steam_deploy.sh Outdated Show resolved Hide resolved
Copy link
Member

@davidmfinol davidmfinol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and confirmed that it is working for Linux again with elif [ "$RUNNER_OS" = "Linux" ]; then at https://github.com/finol-digital/Card-Game-Simulator/actions/runs/3123780055

@wilg Can you test with your mac and windows once more to confirm we didn't break there?
Then we should be good to merge this.

@wilg
Copy link
Contributor Author

wilg commented Sep 26, 2022

Yep, still working on Mac and Windows

@davidmfinol davidmfinol merged commit 0b3710e into game-ci:main Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants