workflow #31
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: Create Release | |
on: | |
# push: | |
# tags: | |
# - '*' | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get version from config.make | |
id: get_version | |
run: | | |
VERSION=$(sed -ne 's/^VERSION := //p' config.make | tr -d '\n') | |
echo "::set-output name=version::$VERSION" | |
- name: Download Binary using wget | |
run: | | |
wget https://github.com/michael105/static-bin/raw/refs/heads/main/xorg/slterm | |
chmod a+x slterm | |
mv slterm slterm_linux_amd64 | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.get_version.outputs.version }} | |
release_name: Release ${{ steps.get_version.outputs.version }} | |
body: | | |
automated package builds | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./slterm_linux_amd64 | |
asset_name: slterm_linux_amd64 | |
asset_content_type: application/octet-stream | |
- name: build static package | |
run: | | |
VERSION=${{ steps.get_version.outputs.version }} | |
echo Version - $VERSION | |
sed -i "s/VERSION/$VERSION/" dist/debian/DEBIAN/control | |
cp dist/debian/DEBIAN/control ./control.tmp | |
sed -i "/^Depends:/d" dist/debian/DEBIAN/control | |
cat dist/debian/DEBIAN/control | |
mkdir -p dist/debian/usr/local/bin | |
cp slterm_linux_amd64 dist/debian/usr/local/bin/slterm | |
mkdir -p dist/debian/usr/local/share/man/man1 | |
cp src/slterm.1 dist/debian/usr/local/share/man/man1/ | |
mkdir -p dist/debian/usr/local/share/doc/slterm | |
cp -R README.md LICENSE PATCHES.md test dist/debian/usr/local/share/doc/slterm/ | |
mkdir dist/debian/usr/local/share/doc/slterm/doc | |
cp doc/BLURP.md doc/ansi_escape_sequences.txt doc/ascii-controlchars-vt102.txt doc/ascii_0-127.png doc/ascii_0-127.txt doc/ascii_128-255.png doc/ascii_128-255.txt doc/colornames.html doc/colornames_gray.html doc/fontconfig.txt doc/patches-applied dist/debian/usr/local/share/doc/slterm/doc/ | |
dpkg-deb --build dist/debian slterm_${{ steps.get_version.outputs.version }}_static.deb | |
- name: upload static package | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: slterm_${{ steps.get_version.outputs.version }}_static.deb | |
asset_name: slterm_${{ steps.get_version.outputs.version }}_static.deb | |
asset_content_type: application/vnd.debian.binary-package | |
- name: build requisites | |
run: sudo apt-get install libfreetype-dev x11proto-dev fontconfig libx11-dev libxft-dev python3-docutils | |
- name: make | |
run: make | |
- name: make check | |
run: make check | |
- name: Install project | |
run: | | |
rm dist/debian/usr/local/bin/slterm | |
cp ./control.tmp dist/debian/DEBIAN/control | |
sudo make install DESTDIR=$(pwd)/dist/debian | |
- name: build package | |
run: | | |
cat dist/debian/DEBIAN/control | |
dpkg-deb --build dist/debian slterm_${{ steps.get_version.outputs.version }}.deb | |
- name: package check | |
run: | | |
sudo apt-get install libfreetype6 libxft2 libfontconfig1 fonts-liberation | |
sudo dpkg -i slterm_${{ steps.get_version.outputs.version }}.deb | |
slterm -V | |
- name: upload package | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: slterm_${{ steps.get_version.outputs.version }}.deb | |
asset_name: slterm_${{ steps.get_version.outputs.version }}.deb | |
asset_content_type: application/vnd.debian.binary-package | |