{"id":23053134,"url":"https://github.com/sctg-development/github-runner-vs2010","last_synced_at":"2025-04-03T04:23:41.719Z","repository":{"id":267683888,"uuid":"902037333","full_name":"sctg-development/github-runner-vs2010","owner":"sctg-development","description":"🏃‍♂️ Self-hosted GitHub runner in a Windows container with Visual Studio 2010 and Windows SDK 7.1a for building Windows XP compatible applications.","archived":false,"fork":false,"pushed_at":"2025-03-08T09:44:28.000Z","size":43654,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T10:27:20.054Z","etag":null,"topics":["github-runners","self-hosted-runner","windows-xp-compatible"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/sctg/github-runner-vs2010","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sctg-development.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yaml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["sctg-development"]}},"created_at":"2024-12-11T19:31:51.000Z","updated_at":"2025-03-08T09:44:31.000Z","dependencies_parsed_at":"2024-12-11T20:36:24.778Z","dependency_job_id":"89b24190-878f-48df-90aa-3d76c271ba2b","html_url":"https://github.com/sctg-development/github-runner-vs2010","commit_stats":null,"previous_names":["sctg-development/github-runner-vs2010"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sctg-development%2Fgithub-runner-vs2010","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sctg-development%2Fgithub-runner-vs2010/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sctg-development%2Fgithub-runner-vs2010/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sctg-development%2Fgithub-runner-vs2010/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sctg-development","download_url":"https://codeload.github.com/sctg-development/github-runner-vs2010/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246934855,"owners_count":20857285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-runners","self-hosted-runner","windows-xp-compatible"],"created_at":"2024-12-16T00:16:39.887Z","updated_at":"2025-04-03T04:23:41.682Z","avatar_url":"https://github.com/sctg-development.png","language":"PowerShell","readme":"# GitHub Runner with Visual Studio 2010\n\nThis repository provides a Docker image `sctg/github-runner-vs2010:2.322.0` for running a self-hosted GitHub runner with Visual Studio 2010 and Windows SDK 7.1a. The main purpose is to enable building Windows XP-compatible applications, as GitHub's standard runners no longer support Visual Studio 2010 and Microsoft has ended Windows XP support.\n\n## Prerequisites\n\n- Docker installed on your host machine\n- A GitHub account with appropriate permissions\n- A Personal Access Token (PAT) from GitHub\n- Windows Server 2019 (for running Windows containers)\n\n## Setting Up Self-Hosted Runners in GitHub\n\nBefore running the Docker container, you need to configure your GitHub repository to accept self-hosted runners:\n\n1. Go to your GitHub repository settings\n2. Navigate to \"Settings\" → \"Actions\" → \"Runners\"\n3. Click on \"New self-hosted runner\"\n4. Note down the repository URL and token (you'll need these later)\n\nImportant security considerations:\n\n- Self-hosted runners should only be used in private repositories by default\n- If using in public repositories, enable the \"Require approval for all outside collaborators\" setting\n- Set up runner groups to control access to runners\n- Configure allowed actions and workflows in repository settings\n\nRunner labels:\n\n- Add relevant labels to your runner (e.g., 'windows-2019', 'vs2010')\n- These labels are used in workflow files to target specific runners\n\n## Running Windows Docker Containers on Windows Server 2019\n\n### Prerequisites\n\n1. Install Windows Server 2019 with Desktop Experience\n2. Enable Containers and Hyper-V features:\n\n```powershell\nInstall-WindowsFeature Containers\nInstall-WindowsFeature Hyper-V\nRestart-Computer -Force\n```\n\n3. Install Docker:\n\n```powershell\n# Install Docker\nInvoke-WebRequest -UseBasicParsing \"https://raw.githubusercontent.com/microsoft/Windows-Containers/master/helpful_tools/Install-DockerCE/install-docker-ce.ps1\" -OutFile install-docker-ce.ps1\n.\\install-docker-ce.ps1\n\n# Start Docker service\nStart-Service docker\n\n# Switch to Windows containers\n\u0026 $Env:ProgramFiles\\Docker\\Docker\\DockerCli.exe -SwitchWindowsEngine\n\n# Test Docker installation\ndocker version\n```\n\n4. Configure Docker for Windows containers:\n\n```powershell\n# Set Docker to use Windows containers by default\n[Environment]::SetEnvironmentVariable(\"DOCKER_DEFAULT_PLATFORM\", \"windows\", \"Machine\")\n```\n\n### Running the Container\n\nWhen running Windows containers, ensure you use the correct isolation mode:\n\n```powershell\n\u0026 $Env:ProgramFiles\\Docker\\Docker\\DockerCli.exe -SwitchWindowsEngine\ndocker run --isolation=hyperv -it -e GH_TOKEN='your_github_token' -e GH_OWNER='your_github_owner' -e GH_REPOSITORY='your_github_repo' sctg/github-runner-vs2010:2.322.0\n# or for organizations, you may need to specify the `GH_ORG` as `your_github_org`.\ndocker run --isolation=hyperv -it -e GH_TOKEN='your_github_token' -e GH_ORG='your_github_org' sctg/github-runner-vs2010:2.322.0\n```\n\n## Building the Docker Image\n\nTo build the Docker image, run the following command:\n\n```sh\n\u0026 $Env:ProgramFiles\\Docker\\Docker\\DockerCli.exe -SwitchWindowsEngine\ndocker build . --tag sctg/github-runner-vs2010:2.322.0 --tag sctg/github-runner-vs2010:latest --push\n```\n\n## Running the Docker Container\n\nTo run the Docker container, you need to provide the following environment variables:\n\n- `GH_TOKEN`: Your GitHub Personal Access Token with the minimum required scopes: `repo`, `read:org`.\n- `GH_OWNER`: The owner of the repository (user or organization).\n- or `GH_ORG`: The organization of the repository.\n- `GH_REPOSITORY`: The name of the repository.\n\nRun the container with the following command:\n\n```sh\ndocker run --isolation=hyperv -it -e GH_TOKEN='your_github_token' -e GH_OWNER='your_github_owner' -e GH_REPOSITORY='your_github_repo' sctg/github-runner-vs2010:2.322.0\n```\n\n## Using the Runner in GitHub Workflows\n\nTo use this runner in your GitHub workflows, you need to specify the `runs-on` field with your self-hosted runner label.  \nWithout modification the labels self-hosted, windows, vs2010 and self-hosted-vs2010 are defined.  \nHere's a sample real workflow that builds a Windows XP-compatible application using the sample [build.ps1](build.ps1) script:\n\n```yaml\nname: Build Windows XP App\n\non:\n  workflow_dispatch:\n  release:\n    types: [published]\n\npermissions:\n    contents: write\n    pages: write\n    id-token: write\n    packages: write\n    attestations: write\n\njobs:\n  build:\n    runs-on: self-hosted-vs2010  # Use https://github.com/sctg-development/github-runner-vs2010\n    \n    steps:\n    - uses: actions/checkout@v4\n      with:\n         fetch-depth: 1\n    \n    # this is a real example of a restore script for a Qt project\n    - name: Restore Qt487\n      shell: bash\n      run: |\n        _PWD=$(pwd)\n        echo \"Running in $_PWD\"\n        ./big-restore.sh\n        cd /c/\n        7z x -y \"$_PWD/Qt487static.zip\"\n\n    - name: Build Release\n      continue-on-error: true\n      shell: powershell\n      run: |\n        ./build.ps1 -Configurations \"Release\" -workspace $PWD -dism 0\n\n    # - name: Setup MSBuild\n    #   shell: cmd\n    #   run: |\n    #     call \"C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\vcvarsall.bat\" x86\n        \n    - name: Build Solution\n      shell: cmd\n    # This is or real build\n    # build.ps1 is provided as an example in the repo\n    - name: Build Release Verbose\n      continue-on-error: true\n      shell: powershell\n      run: |\n        ./build.ps1 -Configurations \"Release Verbose\" -workspace $PWD -dism 0\n            \n    - name: Upload Release Artifacts\n      uses: actions/upload-artifact@v4\n      with:\n        name: windows-xp-build Release\n        path: \"./Release/Application/**\"\n\n    - name: Upload Realease Verbose Artifacts\n      uses: actions/upload-artifact@v4\n      with:\n        name: windows-xp-build Release Verbose\n        path: \"./Release Verbose//Application/**\"\n    \n    - name: Upload full build\n      uses: actions/upload-artifact@v4\n      with:\n        name: windows-xp-build\n        path: \"./\"\n\n    - name: Create zip file with built files\n      shell: bash\n      run: |\n        7z a -tzip myapp-Release.zip \"./Release/Application/**\"\n        7z a -tzip myapp-Release-Verbose.zip \"./Release Verbose/Application/**\"\n\n    - name: Create Release with gh and extract version from built file\n      env:\n        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n      shell: powershell\n      run: |\n        $version = Get-Item -Path \"./Release/Application/myapp.exe\" | Select-Object -ExpandProperty VersionInfo\n        $revision = $version.FileVersionRaw.Revision\n        $major = $version.FileVersionRaw.Major\n        $minor = $version.FileVersionRaw.Minor\n        $build = $version.FileVersionRaw.Build\n        $TAG_NAME = \"v$major.$minor.$build.$revision\"\n\n        Write-Output $TAG_NAME\n    \n        try {\n            gh release create $TAG_NAME -t \"$TAG_NAME\" -n \"$TAG_NAME\"\n        } catch {\n            Write-Output \"Release may already exist, continuing...\"\n        }\n        \n        gh release upload $TAG_NAME novasulf-ii-Release.zip --clobber\n        gh release upload $TAG_NAME novasulf-ii-Release-Verbose.zip --clobber\n\n```\n\nNote: Replace `YourSolution.sln` and paths with your actual project files and build output locations.\n\n## How it Works\n\nThe Dockerfile sets up the environment with:\n\n- Visual Studio 2010\n- .NET Framework 4.8\n- Windows SDK 7.0\n- Windows SDK 7.1a\n- GitHub runner (version 2.322.0 by default)\n\nThe `start.ps1` script handles the container initialization by:\n\n1. Authenticating with GitHub using the provided `GH_TOKEN`\n2. Obtaining a registration token for the GitHub runner\n3. Registering the runner with the specified repository\n4. Starting the runner process\n\n## Troubleshooting\n\nCommon issues and solutions:\n\n1. **Runner Registration Fails**:\n   - Verify your PAT has the correct permissions\n   - Ensure the repository exists and you have access to it\n\n2. **Build Failures**:\n   - Check that your solution targets Visual Studio 2010 toolset\n   - Verify Windows SDK 7.1a paths are correct\n\n3. **Docker Container Issues**:\n   - Ensure you're using process isolation mode on Windows Server 2019\n   - Verify Docker is configured for Windows containers\n   - Check container logs for startup errors\n\n## Cleanup\n\nWhen the Docker container is stopped, the runner registration is automatically removed from GitHub. However, if you encounter stale runners, you can use the provided `Cleanup-Runners.ps1` script:\n\n```powershell\n.\\Cleanup-Runners.ps1 -Owner your_github_owner -Repository your_github_repo -Token your_github_token\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## Author\n\n- **Ronan L**\n- Email: [ronan@sctg-development.eu.org](mailto:ronan@sctg-development.eu.org)\n- GitHub: [sctg-development/github-runner-vs2010](https://github.com/sctg-development/github-runner-vs2010)\n\n## License\n\nThis project is licensed under the GNU Affero General Public License version 3.\n","funding_links":["https://github.com/sponsors/sctg-development"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsctg-development%2Fgithub-runner-vs2010","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsctg-development%2Fgithub-runner-vs2010","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsctg-development%2Fgithub-runner-vs2010/lists"}