Skip to content

Commit

Permalink
Add workflow file to upload packages to S3
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexRuiz7 committed Mar 6, 2024
1 parent fd18899 commit bb74237
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,11 @@ jobs:
test:
needs: [version, commit_sha, assemble]
uses: ./.github/workflows/r_test.yml
with:
package: wazuh-indexer-${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}-amd64_${{ needs.commit_sha.outputs.commit_sha }}.deb

upload:
needs: [version, commit_sha, test]
uses: ./.github/workflows/r_upload.yml
with:
package: wazuh-indexer-${{ needs.version.outputs.version }}-${{ github.event_name == 'push' && '1' || inputs.revision }}-amd64_${{ needs.commit_sha.outputs.commit_sha }}.deb
38 changes: 38 additions & 0 deletions .github/workflows/r_upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Upload (reusable)

# This workflow runs when any of the following occur:
# - Run from another workflow
on:
workflow_call:
inputs:
package:
description: "The name of the package to upload to Wazuh's S3 development artifactory bucket."
required: true
type: string

jobs:
r_test:
runs-on: ubuntu-latest
# Permissions to upload the package
permissions:
packages: read
contents: read
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.package }}
path: artifacts/dist

- name: Set up AWS CLI
uses: aws-actions/configure-aws-credentials@v1
if: success()
with:
aws-access-key-id: ${{ secrets.CI_INTERNAL_DEVELOPMENT_BUCKET_USER_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.CI_INTERNAL_DEVELOPMENT_BUCKET_USER_SECRET_KEY }}
aws-region: us-east-1

- name: Upload package to S3
if: success()
run: |
aws s3 cp artifacts/dist/${{ inputs.package }} s3://packages-dev.internal.wazuh.com/development/wazuh/4.x/main/packages/

0 comments on commit bb74237

Please sign in to comment.