mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-07-08 18:06:30 +00:00
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
81 lines
2.1 KiB
YAML
81 lines
2.1 KiB
YAML
name: Build CCExtractor Snap
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build_snap:
|
|
name: Build Snap package
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Install snapd
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y snapd
|
|
|
|
- name: Start snapd
|
|
run: |
|
|
sudo systemctl start snapd.socket
|
|
sudo systemctl start snapd
|
|
|
|
- name: Install Snapcraft
|
|
run: |
|
|
sudo snap install core22
|
|
sudo snap install snapcraft --classic
|
|
|
|
- name: Show Snapcraft version
|
|
run: snapcraft --version
|
|
|
|
- name: Set Snap version from tag
|
|
if: github.event_name == 'release'
|
|
run: |
|
|
# Extract version from GITHUB_REF (handles both v0.96.6 and 0.96.6 tags)
|
|
VERSION="${GITHUB_REF#refs/tags/}"
|
|
VERSION="${VERSION#v}"
|
|
VERSION="${VERSION%%-*}"
|
|
VERSION="${VERSION//[[:space:]]/}"
|
|
|
|
if [ -z "$VERSION" ]; then
|
|
echo "ERROR: Version is empty after parsing GITHUB_REF: $GITHUB_REF" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ ${#VERSION} -gt 32 ]; then
|
|
echo "Snap version too long: $VERSION" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Verify snapcraft.yaml has a version line before modifying
|
|
if ! grep -q '^version:' snap/snapcraft.yaml; then
|
|
echo "ERROR: No version line found in snap/snapcraft.yaml" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "Setting snap version to: $VERSION"
|
|
sed -i "s/^version: .*/version: '${VERSION}'/" snap/snapcraft.yaml
|
|
grep -m1 '^version:' snap/snapcraft.yaml
|
|
|
|
- name: Build snap
|
|
run: sudo snapcraft --destructive-mode
|
|
|
|
- name: List generated snap
|
|
run: ls -lh *.snap
|
|
|
|
- name: Upload snap as workflow artifact
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: CCExtractor Snap
|
|
path: "*.snap"
|
|
|
|
- name: Upload snap to GitHub Release
|
|
if: github.event_name == 'release'
|
|
uses: softprops/action-gh-release@v3
|
|
with:
|
|
files: "*.snap"
|