Skip to content

Refactor release_test_python.yml to simplify artifact creation steps … #2

Refactor release_test_python.yml to simplify artifact creation steps …

Refactor release_test_python.yml to simplify artifact creation steps … #2

name: Create Artifacts 🛠️📦
on:
workflow_call:
inputs:
python-version:
required: true
type: string
secrets:
PYPI_TOKEN:
required: true
GITHUB_TOKEN:

Check failure on line 12 in .github/workflows/create_artifacts.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/create_artifacts.yml

Invalid workflow file

secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
required: true
jobs:
build_artifacts:
name: 🏗️ Build Artifacts
runs-on: ubuntu-latest
steps:
- name: 📦 Checkout Code
uses: actions/checkout@v3
- name: 🐍 Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
cache: pip
- name: 🛠️ Install Build Tools
run: |
echo "Installing build tools..."
python -m pip install hatch tomli tomli-w
- name: 📌 Pin Dependencies
run: |
echo "Pinning dependencies..."
python utility/pin_dependencies.py
- name: 🏗️ Build Source Tarball and Binary Wheel
run: |
echo "Building packages..."
hatch build -c
- name: 📄 Generate cumulusci.yml with Version Suffix
run: |
echo "Generating cumulusci.yml with version suffix..."
VERSION="$(hatch version)"
cp cumulusci/cumulusci.yml cumulusci/cumulusci-${VERSION}.yml
- name: 🔄 Convert YAML to JSON Without Indent
run: |
echo "Converting YAML to JSON..."
VERSION="$(hatch version)"
yq eval -o=json cumulusci/cumulusci-${VERSION}.yml > cumulusci/cumulusci-${VERSION}.json
- name: 🛠️ Generate JSON Schema
run: |
echo "Generating JSON schema..."
VERSION="$(hatch version)"
cp cumulusci/schema/schema.json cumulusci/schema/schema-${VERSION}.json
- name: 📤 Upload Artifacts to Job Outputs
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
cumulusci/cumulusci-*.yml
cumulusci/cumulusci-*.json
cumulusci/schema/schema-*.json