Update ci.yml #21
This file contains hidden or 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: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: recursive | |
- name: Set up Theos | |
uses: actions/[email protected] | |
with: | |
repository: theos/theos | |
ref: master | |
path: theos | |
submodules: recursive | |
- name: Install dependencies | |
run: | | |
brew install ldid | |
- name: Check control | |
id: control_changed | |
uses: dorny/[email protected] | |
with: | |
list-files: shell | |
filters: | | |
control: | |
- './control' | |
- name: Build | |
run: | | |
if [ "${{ steps.control_changed.outputs.control }}" = "true" ]; then | |
make package FINALPACKAGE=1 | |
else | |
make package | |
fi | |
PACKAGE=$(ls packages/ | grep .deb) | |
if [ -z "$PACKAGE" ]; then | |
echo "No packages found." | |
exit 1 | |
fi | |
mv "packages/$PACKAGE" "packages/${PACKAGE%.deb}-${{ github.sha }}.deb" | |
echo "DEB_PACKAGE=${PACKAGE%.deb}-${{ github.sha }}.deb" >> $GITHUB_ENV | |
env: | |
THEOS: ${{ github.workspace }}/theos | |
- name: Set release details | |
run: | | |
echo "VERSION=$(grep '^Version:' ./control | cut -d ' ' -f 2)" >> $GITHUB_ENV | |
echo "COMMIT_MESSAGE=$(git log -1 --pretty=%B)" >> $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.COMMIT_MESSAGE }} | |
draft: false | |
prerelease: true | |
files: ./packages/${{ env.DEB_PACKAGE }} |