Build and release DontEatMyContent #12
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
name: Build and release DontEatMyContent | |
on: | |
push: | |
paths: | |
- control | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout DontEatMyContent | |
uses: actions/[email protected] | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: Checkout Theos | |
uses: actions/[email protected] | |
with: | |
repository: theos/theos | |
ref: master | |
path: theos | |
submodules: recursive | |
- name: Install dependencies | |
run: | | |
brew install ldid | |
bash -c "$(curl -fsSL https://raw.githubusercontent.com/roothide/theos/master/bin/install-theos)" | |
- name: Build | |
run: | | |
make package FINALPACKAGE=1 | |
make package FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=rootless | |
make package FINALPACKAGE=1 THEOS_PACKAGE_SCHEME=roothide | |
PACKAGE=$(ls packages/ | grep .deb) | |
if [ -z "$PACKAGE" ]; then | |
echo "No packages found." | |
exit 1 | |
fi | |
for PACKAGE in $PACKAGES; do | |
mv "packages/$PACKAGE" "packages/${PACKAGE%.deb}-${{ github.sha }}.deb" | |
echo "Renamed $PACKAGE to ${PACKAGE%.deb}-${{ github.sha }}.deb" | |
done | |
env: | |
THEOS: ${{ github.workspace }}/theos | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: packages | |
path: packages/ | |
- name: Set release details | |
run: | | |
git fetch --prune | |
LAST_TAG=$(git describe --tags --abbrev=0 --always) | |
echo "Last tag: $LAST_TAG" | |
if [ "$LAST_TAG" != "" ]; then | |
COMMITS=$(git log $LAST_TAG..HEAD --pretty=format:"- %s (%h)") | |
echo "COMMITS<<EOF" >> $GITHUB_ENV | |
echo "$COMMITS" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
else | |
echo "No tags found." | |
fi | |
echo "VERSION=$(grep '^Version:' ./control | cut -d ' ' -f 2)" >> $GITHUB_ENV | |
echo "SHA=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV | |
env: | |
THEOS: ${{ github.workspace }}/theos | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: v${{ env.VERSION }}-${{ env.SHA }} | |
name: v${{ env.VERSION }}-${{ env.SHA }} | |
body: | | |
## What's New | |
${{ env.COMMITS }} | |
prerelease: true | |
files: | | |
packages/*.deb |