Skip to content

Commit

Permalink
Separate publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
amercader committed Dec 4, 2024
1 parent 2fbd51c commit f1282ea
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 31 deletions.
32 changes: 1 addition & 31 deletions .github/workflows/build-deb-package.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CKAN deb packages build workflow

on:
workflow_call:
push:
paths-ignore:
- 'README.md'
Expand Down Expand Up @@ -61,34 +62,3 @@ jobs:
with:
name: ${{ env.OUTPUT_FILE }}
path: ${{ env.OUTPUT_FILE }}

upload-to-s3:
needs: build
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
steps:
- uses: actions/download-artifact@v4
with:
pattern: python-ckan*
merge-multiple: true
- name: Generate hash and upload
run: |
# Download current md5sum file
aws s3 cp s3://${{ secrets.AWS_BUCKET }}/md5sum .
for file in python-ckan*; do
# Remove current md5sum entry
sed -i "/$file/d" md5sum
# Add updated entry to md5sum file
md5sum $file >> md5sum
# Upload deb file
aws s3 cp $file s3://${{ secrets.AWS_BUCKET }}/staging/$file
done
# Upload updated md5sum file
aws s3 cp md5sum s3://${{ secrets.AWS_BUCKET }}/staging/md5sum
43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CKAN deb packages publish workflow

on:
push:
tags:
- 'v*'

jobs:
call-build-workflow:
uses: ./.github/workflows/build-deb-package.yml

upload-to-s3:
needs: call-build-workflow
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
steps:
- uses: actions/download-artifact@v4
with:
pattern: python-ckan*
merge-multiple: true
- name: Generate hash and upload
run: |
# Download current md5sum file
aws s3 cp s3://${{ secrets.AWS_BUCKET }}/md5sum .
for file in python-ckan*; do
# Remove current md5sum entry
sed -i "/$file/d" md5sum
# Add updated entry to md5sum file
md5sum $file >> md5sum
# Upload deb file
aws s3 cp $file s3://${{ secrets.AWS_BUCKET }}/staging/$file
done
# Upload updated md5sum file
aws s3 cp md5sum s3://${{ secrets.AWS_BUCKET }}/staging/md5sum

0 comments on commit f1282ea

Please sign in to comment.