Skip to content

Commit

Permalink
Release Artifact Uploading as "Storage" (#180)
Browse files Browse the repository at this point in the history
* Add artifact uploading and YAML linting to GitHub Actions Workflows
  • Loading branch information
ebb-earl-co committed Jun 4, 2024
1 parent 6672232 commit 9bb2483
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 60 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-github-packages
name: Docker Image CI

Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/pyinstaller-linux.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
---
name: Pyinstaller Build on Ubuntu 24.04 for GNU/Linux x86_64
on:
release:
types: ["published"]
push:
branches: ["develop", "trunk"]

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: awalsh128/cache-apt-pkgs-action@latest
with:
version: 1.0
packages: g++ gcc git make pkg-config yasm

- name: Cache FFmpeg n7.0
id: cache-ffmpeg
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/ffmpeg-n7.0
key: ffmpeg-${{ hashFiles('ffmpeg-n7.0') }}

- name: Clone FFmpeg, n7.0 tag
if: ${{ steps.cache-ffmpeg.outputs.cache-hit != 'true' }}
id: clone-ffmpeg-from-github
Expand All @@ -38,7 +33,6 @@ jobs:
path: ffmpeg-n7.0
ref: n7.0
fetch-depth: 1

- name: Build FFmpeg from source (git submodule)
run: |
cd ffmpeg-n7.0
Expand Down Expand Up @@ -69,21 +63,18 @@ jobs:
--enable-protocol=file \
--enable-small
make -j$(nproc)
- name: Set up Python
uses: actions/setup-python@v5
with:
architecture: "x64"
cache: "pip"
check-latest: false
python-version: "3.12.3"

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install pyinstaller==6.7.0
python3 -m pip install -r requirements.txt
- name: Create Executable with PyInstaller
run: |
pyinstaller \
Expand All @@ -97,17 +88,25 @@ jobs:
--onefile \
--strip \
./pyinstaller.py
- name: Test just-compiled binary
run: |
chmod +x ./dist/tidal-wave_ubuntu_24.04_amd64
./dist/tidal-wave_ubuntu_24.04_amd64 --help
- name: Create SHA256 checksum file of just-compiled binary
run: |
python3 -c "from hashlib import sha256;from pathlib import Path;Path('tidal-wave_ubuntu_24.04_amd64.sha256').write_text(f'''{sha256(Path('./dist/tidal-wave_ubuntu_24.04_amd64').read_bytes()).hexdigest()}\ttidal-wave_ubuntu_24.04_amd64''')"
cat tidal-wave_ubuntu_24.04_amd64.sha256
- name: Upload Artifact
uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/')
with:
compression-level: 9
name: tidal-wave_ubuntu
overwrite: true
path: |
./dist/tidal-wave_ubuntu_24.04_amd64
tidal-wave_ubuntu_24.04_amd64.sha256
retention-days: 7
- name: Add artifact to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
Expand Down
29 changes: 12 additions & 17 deletions .github/workflows/pyinstaller-macos_arm64.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,41 @@
---
name: Pyinstaller Build on macOS for macOS arm64
on:
release:
types: ["published"]
push:
branches: ["develop", "trunk"]

permissions:
contents: write

jobs:
build:
runs-on: macos-14

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v4
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-

- name: Install Homebrew Bundler RubyGems
if: steps.cache.outputs.cache-hit != 'true'
run: brew install-bundler-gems

- name: Update Homebrew
id: update-homebrew
continue-on-error: true
run: |
brew update --preinstall
# https://trac.ffmpeg.org/wiki/CompilationGuide/macOS#InstallingdependencieswithHomebrew
- name: Get FFmpeg dependencies from Homebrew
id: brew-install-ffmpeg-deps
run: brew install automake libtool nasm shtool xvid

- name: Clone FFmpeg, n7.0 tag
id: clone-ffmpeg-from-github
uses: actions/checkout@v4
Expand All @@ -52,14 +44,12 @@ jobs:
path: ffmpeg-n7.0
ref: n7.0
fetch-depth: 1

- name: Cache compiled ffmpeg
uses: actions/cache@v4
id: cache-ffmpeg-darwin-arm64
with:
path: ffmpeg-n7.0/ffmpeg
key: macos-arm64-compiled-ffmpeg-n7.0

- name: Build FFmpeg from source
if: steps.cache-ffmpeg-darwin-arm64.outputs.cache-hit != 'true'
id: compile-ffmpeg
Expand Down Expand Up @@ -94,20 +84,17 @@ jobs:
--enable-protocol=file \
--enable-small
make -j$(sysctl -n hw.logicalcpu)
- name: Set up Python
uses: actions/setup-python@v5
with:
cache: "pip"
check-latest: false
python-version: "3.12.3"

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install pyinstaller==6.7.0
python3 -m pip install -r requirements.txt
- name: Create Executable with Pyinstaller
run: |
pyinstaller \
Expand All @@ -121,16 +108,24 @@ jobs:
--onefile \
--strip \
./pyinstaller.py
- name: Test just-compiled binary
run: |
./dist/tidal-wave_macos_aarch64 --help
- name: Create SHA256 checksum file of just-compiled binary
run: |
python3 -c "from hashlib import sha256;from pathlib import Path;Path('tidal-wave_macos_aarch64.sha256').write_text(f'''{sha256(Path('./dist/tidal-wave_macos_aarch64').read_bytes()).hexdigest()}\ttidal-wave_macos_aarch64''')"
cat tidal-wave_macos_aarch64.sha256
- name: Upload Artifact
uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/')
with:
compression-level: 9
name: tidal-wave_macos_aarch64
overwrite: true
path: |
./dist/tidal-wave_macos_aarch64
tidal-wave_macos_aarch64.sha256
retention-days: 7
- name: Add artifact to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
Expand Down
29 changes: 12 additions & 17 deletions .github/workflows/pyinstaller-macos_x86.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,47 @@
---
name: Pyinstaller Build on macOS for macOS x86_64
on:
release:
types: ["published"]
push:
branches: ["develop", "trunk"]

permissions:
contents: write

jobs:
build:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
runs-on: macos-13

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v4
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-

- name: Install Homebrew Bundler RubyGems
if: steps.cache.outputs.cache-hit != 'true'
run: brew install-bundler-gems

- name: Update Homebrew
id: update-homebrew
run: |
brew update --preinstall
# https://trac.ffmpeg.org/wiki/CompilationGuide/macOS#InstallingdependencieswithHomebrew
- name: Get FFmpeg dependencies from Homebrew
id: brew-install-ffmpeg-deps
run: brew install automake libtool nasm shtool xvid

- name: Cache FFmpeg n7.0
id: cache-ffmpeg
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/ffmpeg-n7.0
key: ffmpeg-${{ hashFiles('ffmpeg-n7.0') }}

- name: Clone FFmpeg, n7.0 tag
if: ${{ steps.cache-ffmpeg.outputs.cache-hit != 'true' }}
id: clone-ffmpeg-from-github
Expand All @@ -60,7 +51,6 @@ jobs:
path: ffmpeg-n7.0
ref: n7.0
fetch-depth: 1

- name: Build FFmpeg from source
run: |
cd ffmpeg-n7.0
Expand Down Expand Up @@ -91,21 +81,18 @@ jobs:
--enable-protocol=file \
--enable-small
make -j$(sysctl -n hw.logicalcpu)
- name: Set up Python
uses: actions/setup-python@v5
with:
architecture: "x64"
cache: "pip"
check-latest: false
python-version: "3.12.3"

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip pyinstaller setuptools wheel
python3 -m pip install pyinstaller==6.7.0
python3 -m pip install -r requirements.txt
- name: Create Executable with Pyinstaller
run: |
pyinstaller \
Expand All @@ -119,16 +106,24 @@ jobs:
--onefile \
--strip \
./pyinstaller.py
- name: Test just-compiled binary
run: |
./dist/tidal-wave_macos_amd64 --help
- name: Create SHA256 checksum file of just-compiled binary
run: |
python3 -c "from hashlib import sha256;from pathlib import Path;Path('tidal-wave_macos_amd64.sha256').write_text(f'''{sha256(Path('./dist/tidal-wave_macos_amd64').read_bytes()).hexdigest()}\ttidal-wave_macos_amd64''')"
cat tidal-wave_macos_amd64.sha256
- name: Upload Artifact
uses: actions/upload-artifact@v4
if: startsWith(github.ref, 'refs/tags/')
with:
compression-level: 9
name: tidal-wave_macos_amd64
overwrite: true
path: |
./dist/tidal-wave_macos_amd64
tidal-wave_macos_amd64.sha256
retention-days: 7
- name: Add artifact to release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
Expand Down
Loading

0 comments on commit 9bb2483

Please sign in to comment.