Compare commits

...

10 Commits

Author SHA1 Message Date
Dmitry Shibanov 0cf603f701
add release.yml for v1 (#635) 2023-03-27 13:42:46 +02:00
Dmitry Shibanov 0f07f7f756
update actions/core (#625) 2023-03-27 13:07:33 +02:00
Nikita Bykov 9f3aa2c73d
Add test.yml to releases/v1 branch (#176)
* added test.yml

* replaced ubuntu-16.04 with ubuntu-20.04

Co-authored-by: Nikita Bykov <v-nibyko@microsoft.com>
2021-01-04 11:16:26 +01:00
Nikita Bykov 152ba7c4dd
added Scripts to PATH on Windows (#173)
Co-authored-by: Nikita Bykov <v-nibyko@microsoft.com>
2020-12-18 15:32:23 +01:00
Maxim Lobanov da8703fb23
update dist file (#166) 2020-12-08 11:00:17 -05:00
Konrad Pabjan accf675719
Update @actions/core (#142) 2020-09-30 21:55:38 +02:00
Konrad Pabjan 614aa4aa1e
Merge pull request #76 from actions/master
Update releases branch with latest changes
2020-03-26 16:49:22 +01:00
Konrad Pabjan 53d19faf05
Merge pull request #69 from actions/master
Update releases/v1 with changes from master
2020-03-09 10:55:07 +01:00
Konrad Pabjan 948e5343c7
Revert "Update releases/v1 with changes from master (#67)" (#68)
This reverts commit bdd6409dc1.
2020-03-09 10:51:55 +01:00
Konrad Pabjan bdd6409dc1
Update releases/v1 with changes from master (#67)
* Use ncc instead of saving node_modules

* Add branding and correctly point to main file

* Cleanup

* Update release script

* PR Feedback

* Update README.md

* Update README.md

* Update contributors.md

* Update description

* use node-version instead of version (deprecated)

* Update contributors.md

* Update README.md

* Update README.md

* Create yaml-lint-config.yml

* Create lint-yaml.yml

* Update README.md

* Update README.md

* Update contributors.md

* Update README.md

* Update terminology in comments

* Spelling & grammar

* Consistent file name references

* ncc build

* Address YAML linting errors

* Fix quotes

* Bump handlebars from 4.1.2 to 4.5.3

Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.2 to 4.5.3.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.1.2...v4.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

* Run main workflow on PRs

* Match README to action.yml

* Update dist/index.js

* Update checkout action to v2

* Fix cross-platform build matrix example

* output installed version number after setup (#51)

* output installed version number after setup

* set output for the installed version

* Setup python + self hosted runners documentation

* Updates to npm packages (#66)

* npm package updates

* Updates to ncc build

* Update action.yml

* Update action.yml

Co-authored-by: Konrad Pabjan <Konrad.Pabjan@microsoft.com>
Co-authored-by: Edward Thomson <ethomson@edwardthomson.com>
Co-authored-by: conao3 <conao3@gmail.com>
Co-authored-by: Brian Cristante <brcrista@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rui Chen <chenrui333@gmail.com>
Co-authored-by: Madhuri Gummalla <madhurig@github.com>
Co-authored-by: Ye-hyoung Kang <keepyourhonor@gmail.com>
Co-authored-by: Robin Daumann <26201853+robindaumann@users.noreply.github.com>
2020-03-09 10:38:24 +01:00
6 changed files with 2524 additions and 267 deletions

View File

@ -0,0 +1,28 @@
name: Release new action version
on:
release:
types: [released]
workflow_dispatch:
inputs:
TAG_NAME:
description: 'Tag name that the major tag will point to'
required: true
env:
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
permissions:
contents: write
jobs:
update_tag:
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
environment:
name: releaseNewActionVersion
runs-on: ubuntu-latest
steps:
- name: Update the ${{ env.TAG_NAME }} tag
uses: actions/publish-action@v0.2.2
with:
source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}

77
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,77 @@
name: Validate 'setup-python'
on:
pull_request:
paths-ignore:
- '**.md'
jobs:
default-version:
name: Setup default version
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: setup default python
uses: ./
- name: Validate version
run: python --version
- name: Run simple python code
run: python -c 'import math; print(math.factorial(5))'
setup-python:
name: Setup ${{ matrix.python }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
python: [3.5, 3.6, 3.7, 3.8, 3.9]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: setup-python ${{ matrix.python }}
uses: ./
with:
python-version: ${{ matrix.python }}
- name: Validate version
run: |
$pythonVersion = (python --version)
if ("$pythonVersion" -notlike "Python ${{ matrix.python }}.*"){
Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}"
exit 1
}
$pythonVersion
shell: pwsh
- name: Run simple code
run: python -c 'import math; print(math.factorial(5))'
setup-pypy:
name: Setup PyPy ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: setup-python pypy3
uses: ./
with:
python-version: 'pypy3'
- name: setup-python pypy2
uses: ./
with:
python-version: 'pypy2'

2640
dist/index.js vendored

File diff suppressed because it is too large Load Diff

28
package-lock.json generated
View File

@ -5,9 +5,28 @@
"requires": true,
"dependencies": {
"@actions/core": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.3.tgz",
"integrity": "sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w=="
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.0.tgz",
"integrity": "sha512-2aZDDa3zrrZbP5ZYg159sNoLRb61nQ7awl5pSvIq5Qpj81vwDzdMRKzkWJGJuwVvWpvZKx7vspJALyvaaIQyug==",
"requires": {
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
},
"dependencies": {
"@actions/http-client": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.1.0.tgz",
"integrity": "sha512-BonhODnXr3amchh4qkmjPMUO8mFi/zLaaCeCAJZqch8iQqyDnVIkySjB38VHAC8IJ+bnlgfOqlhpyCUZHlQsqw==",
"requires": {
"tunnel": "^0.0.6"
}
},
"uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
}
}
},
"@actions/exec": {
"version": "1.0.3",
@ -4543,8 +4562,7 @@
"tunnel": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
"dev": true
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg=="
},
"tunnel-agent": {
"version": "0.6.0",

View File

@ -23,7 +23,7 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.2.3",
"@actions/core": "^1.10.0",
"semver": "^7.1.3"
},
"devDependencies": {

View File

@ -51,8 +51,11 @@ function binDir(installDir: string): string {
// A particular version of PyPy may contain one or more versions of the Python interpreter.
// For example, PyPy 7.0 contains Python 2.7, 3.5, and 3.6-alpha.
// We only care about the Python version, so we don't use the PyPy version for the tool cache.
function usePyPy(majorVersion: 2 | 3, architecture: string): InstalledVersion {
const findPyPy = tc.find.bind(undefined, 'PyPy', majorVersion.toString());
function usePyPy(
majorVersion: '2' | '3.6',
architecture: string
): InstalledVersion {
const findPyPy = tc.find.bind(undefined, 'PyPy', majorVersion);
let installDir: string | null = findPyPy(architecture);
if (!installDir && IS_WINDOWS) {
@ -77,6 +80,10 @@ function usePyPy(majorVersion: 2 | 3, architecture: string): InstalledVersion {
core.addPath(installDir);
core.addPath(_binDir);
// Starting from PyPy 7.3.1, the folder that is used for pip and anything that pip installs should be "Scripts" on Windows.
if (IS_WINDOWS) {
core.addPath(path.join(installDir, 'Scripts'));
}
const impl = 'pypy' + majorVersion.toString();
core.setOutput('python-version', impl);
@ -186,9 +193,10 @@ export async function findPythonVersion(
): Promise<InstalledVersion> {
switch (version.toUpperCase()) {
case 'PYPY2':
return usePyPy(2, architecture);
return usePyPy('2', architecture);
case 'PYPY3':
return usePyPy(3, architecture);
// keep pypy3 pointing to 3.6 for backward compatibility
return usePyPy('3.6', architecture);
default:
return await useCpythonVersion(version, architecture);
}