-
Notifications
You must be signed in to change notification settings - Fork 11
71 lines (58 loc) · 2 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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
upload-to-release:
needs: call-build-workflow
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: python-ckan*
merge-multiple: true
- name: Create release and upload the deb files
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSIONS=$(cat "VERSIONS.json")
TABLE=$(echo "| Ubuntu Version | CKAN Ref |\n|---|---|\n" && echo $VERSIONS | jq -r '
(.[] | ["| \(.ubuntu_version) | \(.ckan_ref) |\n"]) |
.[]
')
NOTES="This release includes deb packages for the following versions.\n
Please check the relevant file in the Assets section below.
$TABLE
Packages are also available at https://packaging.ckan.org."
gh release create ${{ github.ref_name }} ./python-ckan* --verify-tag --notes "$NOTES"