Skip to content

[3006.x] Migrate workflows off AWS #1

[3006.x] Migrate workflows off AWS

[3006.x] Migrate workflows off AWS #1

Workflow file for this run

---
name: Draft Github Release
on:
workflow_call:
inputs:
salt-version:
type: string
required: true
description: The Salt version to set prior to building packages.
matrix:
required: true
type: string
description: Json job matrix config
env:
COLUMNS: 190
PIP_INDEX_URL: ${{ vars.PIP_INDEX_URL }}
PIP_TRUSTED_HOST: ${{ vars.PIP_TRUSTED_HOST }}
PIP_EXTRA_INDEX_URL: ${{ vars.PIP_EXTRA_INDEX_URL }}
PIP_DISABLE_PIP_VERSION_CHECK: "1"
jobs:
list-artifacts:
name: Download and list all artifacts
runs-on: ubuntu-22.04
steps:
# Checkout here so we can easily use custom actions
- uses: actions/download-artifact@v4
with:
path: artifacts/
- name: List Directory Structure
run: ls -R artifacts/
create-github-release:
name: Download and list all artifacts
runs-on: ubuntu-22.04
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ inputs.salt-version }}
draft: true
prerelease: false
- name: Release Output
run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> "$GITHUB_OUTPUT"
list-source-tarball:
name: Add Source Tarball to Release
needs:
- create-github-release
runs-on: ubuntu-22.04
outputs:
upload_url: ${{ steps.list_files.outputs.files }}
steps:
- uses: actions/download-artifact@v4
with:
name: salt-${{ inputs.salt-version }}.tar.gz
path: artifacts
- id: list-files
run: echo "files=$(ls -l artifacts/| jq -Rn '[inputs | { file: \"\(.)\" }]')" >> "$GITHUB_OUTPUT"

Check failure on line 67 in .github/workflows/draft-release.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/draft-release.yml

Invalid workflow file

You have an error in your yaml syntax on line 67
upload-source-tarball:
name: Upload Source Tarball Artifacts
runs-on: ubunut-22.04
needs:
- list-source-tarball
- create-github-release
strategy:
matrix:
include: ${{ fromJSON(needs.list-source-tarball.outputs.files) }}
steps:
- uses: actions/download-artifact@v4
with:
name: salt-${{ inputs.salt-version }}.tar.gz
path: artifacts
- id: file-type
run: echo "file_type=$( file --mime-type artifacts/${{ matrix.file }} )" >> "$GITHUB_OUTPUT"
- name: Upload Source Tarball
id: upload-release-asset-source
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-github-release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: artifacts/${{ matrix.file }}
asset_name: ${{ matrix.file }}
asset_content_type: ${{ steps.file-type.outputs.file_type }}
release-artifacts:
name: Download and list all artifacts
runs-on: ubuntu-22.04
needs:
- create-github-release
strategy:
matrix:
${{ fromJSON(inputs.matrix)['linux'] + fromJSON(inputs.matrix)["macos"] + fromJSON(inputs.matrix)["windows") }}
steps:
- name: Echo upload url
run: echo ${{ needs.create-github-release.outputs.upload_url }}