-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create GitHub workflows for building and publishing
There are two separate workflows: * `build.yml` builds the deb packages (based on the versions i supplied in `VERSIONS.json`) and stores them as artifacfts in the workflow run page. This is triggered on every push. * Additionally, when a tag is pushed, `publish.yml` also builds the packages and: 1. Uploads them to the S3 bucket powering https://packaging.ckan.org 2. Creates a new GitHub release with the packages attached as asset
- Loading branch information
Showing
5 changed files
with
104 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: CKAN deb packages build workflow | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- v* | ||
|
||
jobs: | ||
call-build-workflow: | ||
uses: ./.github/workflows/reusable-build-package.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: CKAN deb packages publish workflow | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
call-build-workflow: | ||
uses: ./.github/workflows/reusable-build-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") | ||
LIST=$(echo $VERSIONS | jq -r ' | ||
(.[] | ["* \(.ckan_ref) on Ubuntu \(.ubuntu_version)"]) | | ||
.[] | ||
') | ||
NOTES="This release includes deb packages for the following versions. | ||
$LIST | ||
Please check the relevant file in the Assets section below. | ||
Packages are also available at https://packaging.ckan.org." | ||
gh release create ${{ github.ref_name }} ./python-ckan* --verify-tag --notes "$NOTES" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters