Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 169 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
name: Build and publish FastQC release

on:
push:
branches: [master]
pull_request:
release:
types: [published]
workflow_dispatch:
inputs:
tag_name:
description: 'Tag or version string to use in artifact filenames when running manually (e.g., v0.12.1)'
required: false
default: 'dev'

permissions:
contents: write

jobs:
build-zip:
name: Build ZIP (Win/Linux)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Java 11
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '11'

- name: Build with Ant
run: ant clean build

- name: Ensure executable flags
run: chmod +x bin/fastqc

- name: Stage distribution folder
run: |
rm -rf FastQC
mkdir -p FastQC
cp -a bin/. FastQC/

- name: Determine version
id: vars
shell: bash
run: |
if [ "${{ github.event_name }}" = "release" ]; then
echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" = "push" ]; then
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" = "pull_request" ]; then
echo "version=PR-${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
else
echo "version=${{ github.event.inputs.tag_name }}" >> $GITHUB_OUTPUT
fi

- name: Create ZIP archive
run: zip -r "fastqc_${{ steps.vars.outputs.version }}.zip" FastQC

- name: Upload asset to GitHub Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.release.tag_name }}
files: fastqc_${{ steps.vars.outputs.version }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload artifact (manual run)
if: github.event_name != 'release'
uses: actions/upload-artifact@v4
with:
name: fastqc_${{ steps.vars.outputs.version }}.zip
path: fastqc_${{ steps.vars.outputs.version }}.zip

build-dmg:
name: Build DMG (macOS)
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Java 11
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '11'

- name: Build with Ant
run: ant clean build

- name: Ensure executable flags
run: chmod +x bin/fastqc

- name: Stage distribution folder
run: |
mkdir -p FastQC.app/Contents/MacOS
mkdir -p FastQC.app/Contents/Resources
cp -a bin/. FastQC.app/Contents/MacOS/
cp -a bin/uk/ac/babraham/FastQC/Resources/fastqc_icons.icns FastQC.app/Contents/Resources/fastqc_icons.icns
echo "APPL????" > FastQC.app/Contents/PkgInfo
chmod 777 FastQC.app/Contents/PkgInfo
cat > FastQC.app/Contents/Info.plist << 'EOF'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleAllowMixedLocalizations</key>
<string>true</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>fastqc</string>
<key>CFBundleIconFile</key>
<string>fastqc_icons.icns</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>FastQC</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.12.0</string>
</dict>
</plist>
EOF
chmod 777 FastQC.app/Contents/Info.plist



- name: Determine version
id: vars
shell: bash
run: |
if [ "${{ github.event_name }}" = "release" ]; then
echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" = "push" ]; then
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" = "pull_request" ]; then
echo "version=PR-${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
else
echo "version=${{ github.event.inputs.tag_name }}" >> $GITHUB_OUTPUT
fi

- name: Create DMG image
run: |
hdiutil create -volname "FastQC" -srcfolder FastQC.app -ov -format UDZO "fastqc_${{ steps.vars.outputs.version }}.dmg"

- name: Upload asset to GitHub Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.release.tag_name }}
files: fastqc_${{ steps.vars.outputs.version }}.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload artifact (manual run)
if: github.event_name != 'release'
uses: actions/upload-artifact@v4
with:
name: fastqc_${{ steps.vars.outputs.version }}.dmg
path: fastqc_${{ steps.vars.outputs.version }}.dmg


Binary file not shown.
Loading