mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Upload onedir artifacts to release
This commit is contained in:
parent
2d64d40346
commit
e557c3fec3
4 changed files with 71 additions and 61 deletions
66
.github/workflows/draft-release.yml
vendored
66
.github/workflows/draft-release.yml
vendored
|
@ -52,80 +52,28 @@ jobs:
|
|||
- name: Release Output
|
||||
run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
list-source-tarball:
|
||||
name: List Source Tarball Artifacts
|
||||
needs:
|
||||
- create-github-release
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
files: ${{ 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="$(find artifacts -maxdepth 1 -type f -printf '%f\n' | jq -Rnc '[inputs | { file: "\(.)" }]')" >> "$GITHUB_OUTPUT"
|
||||
|
||||
upload-source-tarball:
|
||||
name: Upload Source Tarball Artifacts
|
||||
runs-on: ubuntu-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
|
||||
- uses: ./.github/workflows/release-artifact.yml
|
||||
with:
|
||||
name: salt-${{ inputs.salt-version }}.tar.gz
|
||||
path: artifacts
|
||||
upload_url: ${{ needs.create-github-release.outputs.upload_url }}
|
||||
|
||||
- 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 }}
|
||||
|
||||
list-onedir-linux:
|
||||
name: List Onedir Artifacts Linux
|
||||
upload-onedir:
|
||||
runs-on: ubuntu-22.04
|
||||
needs:
|
||||
- create-github-release
|
||||
outputs:
|
||||
${{ matrix.arch }}-files: ${{ steps.list-files.outputs.files }}
|
||||
strategy:
|
||||
matrix:
|
||||
include: ${{ fromJSON(inputs.matrix)['linux'] }}
|
||||
include: ${{ inputs.matrix }}
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: ./.github/workflows/release-artifact.yml
|
||||
with:
|
||||
name: salt-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch }}.tar.xz
|
||||
path: artifacts
|
||||
- id: list-files
|
||||
run: |
|
||||
echo ${{ matrix.arch }}-files="$(find artifacts -maxdepth 1 -type f -printf '%f\n' | jq -Rnc '[inputs | { file: "\(.)" }]')" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# upload-onedir-linux:
|
||||
# name: Upload Onedir Packages Linux
|
||||
# runs-on: ubuntu-22.04
|
||||
# needs:
|
||||
# - create-github-release
|
||||
# - list-onedir-linux
|
||||
# strategy:
|
||||
# matrix:
|
||||
# include: ${{ fromJSON(needs.list-onedir-linux.outputs.files) }}
|
||||
|
||||
name: salt-${{ inputs.salt-version }}-onedir-${{ matrix.platform }}-${{ matrix.arch }}.${{ matrix.platform == 'windows' && 'zip' || 'tar.xz' }}
|
||||
upload_url: ${{ needs.create-github-release.outputs.upload_url }}
|
||||
|
||||
release-artifacts:
|
||||
name: Download and list all artifacts
|
||||
|
|
61
.github/workflows/release-artifact.yml
vendored
Normal file
61
.github/workflows/release-artifact.yml
vendored
Normal file
|
@ -0,0 +1,61 @@
|
|||
---
|
||||
name: Upload Release Artifact
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
artifact-name:
|
||||
type: string
|
||||
required: true
|
||||
description: The Salt version to set prior to building packages.
|
||||
uload-url:
|
||||
type: string
|
||||
required: true
|
||||
description: Release's upload url.
|
||||
|
||||
|
||||
steps:
|
||||
|
||||
list-files:
|
||||
name: List Files From Artifact
|
||||
needs:
|
||||
- create-github-release
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
files: ${{ steps.list-files.outputs.files }}
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.artifact-name }}
|
||||
path: artifacts
|
||||
- id: list-files
|
||||
run: |
|
||||
echo files="$(find artifacts -maxdepth 1 -type f -printf '%f\n' | jq -Rnc '[inputs | { file: "\(.)" }]')" >> "$GITHUB_OUTPUT"
|
||||
|
||||
upload-files:
|
||||
name: Upload Source Tarball Artifacts
|
||||
runs-on: ubuntu-22.04
|
||||
needs:
|
||||
- list-files
|
||||
strategy:
|
||||
matrix:
|
||||
include: ${{ fromJSON(needs.list-files.outputs.files) }}
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ inputs.artifact-name }}
|
||||
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: ${{ inputs.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 }}
|
2
.github/workflows/staging.yml
vendored
2
.github/workflows/staging.yml
vendored
|
@ -665,7 +665,7 @@ jobs:
|
|||
uses: ./.github/workflows/draft-release.yml
|
||||
with:
|
||||
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
|
||||
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }}
|
||||
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['artifact-matrix']) }}
|
||||
|
||||
set-pipeline-exit-status:
|
||||
# This step is just so we can make github require this step, to pass checks
|
||||
|
|
|
@ -194,6 +194,7 @@ concurrency:
|
|||
uses: ./.github/workflows/draft-release.yml
|
||||
with:
|
||||
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
|
||||
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }}
|
||||
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['artifact-matrix']) }}
|
||||
|
||||
|
||||
<%- endblock jobs %>
|
||||
|
|
Loading…
Add table
Reference in a new issue