Skip to content

Commit

Permalink
Upload more artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Dec 16, 2024
1 parent ffef079 commit badf60d
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 28 deletions.
81 changes: 62 additions & 19 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
required: true
type: string
description: Json job matrix config
build-matrix:
required: true
type: string
description: Json job matrix config

env:
COLUMNS: 190
Expand Down Expand Up @@ -53,36 +57,75 @@ jobs:
run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> "$GITHUB_OUTPUT"

upload-source-tarball:
runs-on: ubuntu-22.04
needs:
- create-github-release
steps:
- uses: ./.github/workflows/release-artifact.yml
with:
name: salt-${{ inputs.salt-version }}.tar.gz
upload_url: ${{ needs.create-github-release.outputs.upload_url }}
uses: ./.github/workflows/release-artifact.yml
with:
name: salt-${{ inputs.salt-version }}.tar.gz
upload_url: ${{ needs.create-github-release.outputs.upload_url }}

upload-onedir:
runs-on: ubuntu-22.04
needs:
- create-github-release
strategy:
matrix:
include: ${{ inputs.matrix }}
steps:
- uses: ./.github/workflows/release-artifact.yml
with:
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 }}
uses: ./.github/workflows/release-artifact.yml
with:
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
runs-on: ubuntu-22.04
upload-deb-packages:
needs:
- create-github-release
strategy:
matrix:
${{ fromJSON(inputs.matrix)['linux'] }}
steps:
- name: Echo upload url
run: echo ${{ needs.create-github-release.outputs.upload_url }}
include: ${{ toJSON(fromJSON(inputs.build-matrix)['linux']) }}
uses: ./.github/workflows/release-artifact.yml
with:
name: salt-${{ inputs.salt-version }}-${{ matrix.arch }}-deb
upload_url: ${{ needs.create-github-release.outputs.upload_url }}

upload-rpm-packages:
needs:
- create-github-release
strategy:
matrix:
include: ${{ toJSON(fromJSON(inputs.build-matrix)['linux']) }}
uses: ./.github/workflows/release-artifact.yml
with:
name: salt-${{ inputs.salt-version }}-${{ matrix.arch }}-rpm
upload_url: ${{ needs.create-github-release.outputs.upload_url }}

upload-mac-packages:
needs:
- create-github-release
strategy:
matrix:
include: ${{ toJSON(fromJSON(inputs.build-matrix)['linux']) }}
uses: ./.github/workflows/release-artifact.yml
with:
name: salt-${{ inputs.salt-version }}-${{ matrix.arch }}-macos
upload_url: ${{ needs.create-github-release.outputs.upload_url }}

upload-windows-msi-packages:
needs:
- create-github-release
strategy:
matrix:
include: ${{ toJSON(fromJSON(inputs.build-matrix)['windows']) }}
uses: ./.github/workflows/release-artifact.yml
with:
name: salt-${{ inputs.salt-version }}-${{ matrix.arch }}-MSI
upload_url: ${{ needs.create-github-release.outputs.upload_url }}

upload-windows-nsis-packages:
needs:
- create-github-release
strategy:
matrix:
include: ${{ toJSON(fromJSON(inputs.build-matrix)['windows']) }}
uses: ./.github/workflows/release-artifact.yml
with:
name: salt-${{ inputs.salt-version }}-${{ matrix.arch }}-NSIS
upload_url: ${{ needs.create-github-release.outputs.upload_url }}
12 changes: 5 additions & 7 deletions .github/workflows/release-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,27 @@ name: Upload Release Artifact
on:
workflow_call:
inputs:
artifact-name:
name:
type: string
required: true
description: The Salt version to set prior to building packages.
uload-url:
upload_url:
type: string
required: true
description: Release's upload url.


steps:
jobs:

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 }}
name: ${{ inputs.name }}
path: artifacts
- id: list-files
run: |
Expand All @@ -43,7 +41,7 @@ steps:
steps:
- uses: actions/download-artifact@v4
with:
name: ${{ inputs.artifact-name }}
name: ${{ inputs.name }}
path: artifacts

- id: file-type
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,12 @@ jobs:
if: |
always() && (needs.test.result == 'success' || needs.test.result == 'skipped') &&
(needs.test-packages.result == 'success' || needs.test-packages.result == 'skipped') &&
needs.prepare-workflow.result == 'success' && needs.build-pkgs-onedir.result == 'success'
needs.prepare-workflow.result == 'success' && needs.build-salt-onedir.result == 'success' &&
needs.build-pkgs-onedir.result == 'success' && needs.pre-commit.result == 'success'
needs:
- prepare-workflow
- pre-commit
- build-salt-onedir
- build-pkgs-onedir
- test-packages
- test
Expand All @@ -666,6 +669,7 @@ jobs:
with:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['artifact-matrix']) }}
build-matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }}

set-pipeline-exit-status:
# This step is just so we can make github require this step, to pass checks
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/templates/staging.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,12 @@ on:
if: |
always() && (needs.test.result == 'success' || needs.test.result == 'skipped') &&
(needs.test-packages.result == 'success' || needs.test-packages.result == 'skipped') &&
needs.prepare-workflow.result == 'success' && needs.build-pkgs-onedir.result == 'success'
needs.prepare-workflow.result == 'success' && needs.build-salt-onedir.result == 'success' &&
needs.build-pkgs-onedir.result == 'success' && needs.pre-commit.result == 'success'
needs:
- prepare-workflow
- pre-commit
- build-salt-onedir
- build-pkgs-onedir
- test-packages
- test
Expand All @@ -195,6 +198,7 @@ on:
with:
salt-version: "${{ needs.prepare-workflow.outputs.salt-version }}"
matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['artifact-matrix']) }}
build-matrix: ${{ toJSON(fromJSON(needs.prepare-workflow.outputs.config)['build-matrix']) }}


<%- endblock jobs %>

0 comments on commit badf60d

Please sign in to comment.