Skip to content

Commit

Permalink
Fix full package version check
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Jun 1, 2024
1 parent 337557a commit dbd6a25
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,20 @@ async function getAioBoto3Version() {
}

async function getTypesAioBotocoreVersions(aiobotocoreVersion) {
const allVersions = await getReleaseVersions('types-aiobotocore')
const versions = allVersions.filter(v => v === aiobotocoreVersion || v.startsWith(`${aiobotocoreVersion}.`))
return sortVersions(versions)
return await getPackageVersions('types-aiobotocore', aiobotocoreVersion)
}

async function getTypesAioBoto3Versions(aioboto3Version) {
const allVersions = await getReleaseVersions('types-aioboto3')
const versions = allVersions.filter(v => v === aioboto3Version || v.startsWith(`${aioboto3Version}.`))
return sortVersions(versions)
return await getPackageVersions('types-aioboto3', aioboto3Version)
}

async function getStubsVersions(boto3Version) {
const allVersions = await getReleaseVersions('boto3-stubs')
const versions = allVersions.filter(v => v === boto3Version || v.startsWith(`${boto3Version}.`))
return await getPackageVersions('boto3-stubs', boto3Version)
}

async function getPackageVersions(packageName, version) {
const allVersions = await getReleaseVersions(packageName)
const versions = allVersions.filter(v => v === version || v.startsWith(`${version}.`))
return sortVersions(versions)
}

Expand Down Expand Up @@ -127,7 +127,7 @@ async function extractVersions() {
core.info(`Build all packages = ${buildAll}`)
core.setOutput('build-all', buildAll)

const versions = await getStubsVersions(boto3Version)
const versions = await getPackageVersions('boto3-stubs', boto3Version)
core.info(`Built versions ${versions}`)

if (context.payload.inputs && context.payload.inputs.stubs_version) {
Expand Down Expand Up @@ -192,7 +192,7 @@ async function extractAioBotocoreVersions() {
core.info(`Extra flags = ${extraFlags}`)
core.setOutput('extra-flags', extraFlags.join(' '))

const versions = await getTypesAioBotocoreVersions(aiobotocoreVersion)
const versions = await getPackageVersions('types-aiobotocore', aiobotocoreVersion)
core.info(`Built versions ${versions}`)

if (context.payload.inputs && context.payload.inputs.stubs_version) {
Expand Down Expand Up @@ -236,7 +236,7 @@ async function extractAioBoto3Versions() {

const force = context.payload.inputs ? context.payload.inputs.force !== 'false' : false

const versions = await getTypesAioBoto3Versions(aioboto3Version)
const versions = await getPackageVersions('types-aioboto3', aioboto3Version)
core.info(`Built versions ${versions}`)

if (context.payload.inputs && context.payload.inputs.stubs_version) {
Expand Down Expand Up @@ -297,6 +297,7 @@ module.exports = {
getReleaseVersions,
getAioBoto3Version,
getBoto3Version,
getPackageVersions,
getStubsVersions,
getBotocoreVersion,
extractVersions,
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_aiobotocore_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
with:
result-encoding: string
script: |
const { getTypesAioBotocoreVersions, getNextPostVersion, setupGlobals } = require('./.github/workflows/helpers.js')
const { getPackageVersions, getNextPostVersion, setupGlobals } = require('./.github/workflows/helpers.js')
setupGlobals({ core, context, fetch })
if (context.payload.inputs && context.payload.inputs.stubs_version) {
Expand All @@ -65,7 +65,7 @@ jobs:
const force = context.payload.inputs ? context.payload.inputs.force !== 'false' : false
const aiobotocoreVersion = "${{ steps.aiobotocore.outputs.result }}"
const versions = await getTypesAioBotocoreVersions(aiobotocoreVersion)
const versions = await getPackageVersions('types-aiobotocore-full', aiobotocoreVersion)
core.info(`Built versions ${versions}`)
if (!versions.length) {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_aiobotocore_stubs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
with:
result-encoding: string
script: |
const { getTypesAioBotocoreVersions, getNextPostVersion, setupGlobals } = require('./.github/workflows/helpers.js')
const { getPackageVersions, getNextPostVersion, setupGlobals } = require('./.github/workflows/helpers.js')
setupGlobals({ core, context, fetch })
if (context.payload.inputs && context.payload.inputs.stubs_version) {
Expand All @@ -72,7 +72,7 @@ jobs:
const force = context.payload.inputs ? context.payload.inputs.force !== 'false' : false
const aiobotocoreVersion = "${{ steps.aiobotocore.outputs.result }}"
const versions = await getTypesAioBotocoreVersions(aiobotocoreVersion)
const versions = await getPackageVersions('types-aiobotocore', aiobotocoreVersion)
core.info(`Built versions ${versions}`)
if (!versions.length) {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_boto3_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
with:
result-encoding: string
script: |
const { getStubsVersions, getNextPostVersion, setupGlobals } = require('./.github/workflows/helpers.js')
const { getPackageVersions, getNextPostVersion, setupGlobals } = require('./.github/workflows/helpers.js')
setupGlobals({ core, context, fetch })
if (context.payload.inputs && context.payload.inputs.stubs_version) {
Expand All @@ -80,7 +80,7 @@ jobs:
const force = context.payload.inputs ? context.payload.inputs.force !== 'false' : false
const boto3Version = "${{ steps.boto3.outputs.result }}"
const versions = await getStubsVersions(boto3Version)
const versions = await getPackageVersions('boto3-stubs-full', boto3Version)
core.info(`Built versions ${versions}`)
if (!versions.length) {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_boto3_stubs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
with:
result-encoding: string
script: |
const { getStubsVersions, getNextPostVersion, setupGlobals } = require('./.github/workflows/helpers.js')
const { getPackageVersions, getNextPostVersion, setupGlobals } = require('./.github/workflows/helpers.js')
setupGlobals({ core, context, fetch })
if (context.payload.inputs && context.payload.inputs.stubs_version) {
Expand All @@ -93,7 +93,7 @@ jobs:
const force = context.payload.inputs ? context.payload.inputs.force !== 'false' : false
const boto3Version = "${{ steps.boto3.outputs.result }}"
const versions = await getStubsVersions(boto3Version)
const versions = await getPackageVersions('boto3-stubs', boto3Version)
core.info(`Built versions ${versions}`)
if (!versions.length) {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_types_aioboto3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
with:
result-encoding: string
script: |
const { getTypesAioBoto3Versions, getNextPostVersion, setupGlobals } = require('./.github/workflows/helpers.js')
const { getPackageVersions, getNextPostVersion, setupGlobals } = require('./.github/workflows/helpers.js')
setupGlobals({ core, context, fetch })
if (context.payload.inputs && context.payload.inputs.stubs_version) {
Expand All @@ -68,7 +68,7 @@ jobs:
const force = context.payload.inputs ? context.payload.inputs.force !== 'false' : false
const aioboto3Version = "${{ steps.aioboto3.outputs.result }}"
const versions = await getTypesAioBoto3Versions(aioboto3Version)
const versions = await getPackageVersions('types-aioboto3', aioboto3Version)
core.info(`Built versions ${versions}`)
if (!versions.length) {
Expand Down

0 comments on commit dbd6a25

Please sign in to comment.