Skip to content

Instantly share code, notes, and snippets.

@seb86
Last active October 30, 2024 17:00
Show Gist options
  • Save seb86/b677b62c618466d4ab42dad21c7495fd to your computer and use it in GitHub Desktop.
Save seb86/b677b62c618466d4ab42dad21c7495fd to your computer and use it in GitHub Desktop.
GitHub Action Workflow: Generate MD5 on Release
name: Generate MD5 on Release
on:
release:
types: [published]
jobs:
generate-md5:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate MD5 checksums
run: |
# Find files, excluding patterns and directories, and generate the MD5 checksum file
find . \
-type f \
! -path "*/.*" \
! -path "*.dist" \
! -path "*.gif" \
! -path "*.html" \
! -path "*.jpg" \
! -path "*.jpeg" \
! -path "*.js" \
! -path "*.json" \
! -path "*.log" \
! -path "*.lock" \
! -path "*.md" \
! -path "*.png" \
! -path "*.scss" \
! -path "*.sh" \
! -path "*.txt" \
! -path "*.xml" \
! -path "*.zip" \
! -path ".*/**" \
! -path ".DS_Store" \
! -path ".htaccess" \
! -path "assets/scss/**" \
! -path "assets/**/*.scss" \
! -path "bin/**" \
! -path "node_modules/**" \
! -path "releases/**" \
! -path "tests/**" \
! -path "vendor/**" \
! -path "unit-tests/**" \
-exec md5sum {} \; > checksums.md5
- name: Attach MD5 file to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./checksums.md5
asset_name: checksums.md5
asset_content_type: text/plain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment