CI: add release action
This commit is contained in:
parent
1f16310797
commit
a10b987f1c
|
@ -5,6 +5,9 @@ name: Build
|
||||||
on: workflow_dispatch
|
on: workflow_dispatch
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# build-release-windows: # LF volunteer; RCs will still be built and signed by hand
|
||||||
|
# build-release-macos: # LF volunteer
|
||||||
|
|
||||||
build-ubuntu1804:
|
build-ubuntu1804:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -0,0 +1,84 @@
|
||||||
|
# This workflow will create a release and store builds to it when an x.y.z tag is pushed
|
||||||
|
|
||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*.*.*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Set env
|
||||||
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV # tag x.y.z will become "Archipelago x.y.z"
|
||||||
|
- name: Create Release
|
||||||
|
uses: softprops/action-gh-release@b7e450da2a4b4cb4bfbae528f788167786cfcedf
|
||||||
|
with:
|
||||||
|
draft: true # don't publish right away, especially since windows build is added by hand
|
||||||
|
prerelease: false
|
||||||
|
name: Archipelago ${{ env.RELEASE_VERSION }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
# build-release-windows: # this is done by hand because of signing
|
||||||
|
# build-release-macos: # LF volunteer
|
||||||
|
|
||||||
|
build-release-ubuntu1804:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Set env
|
||||||
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||||
|
# - code below copied from build.yml -
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install base dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt update
|
||||||
|
sudo apt -y install build-essential p7zip xz-utils wget libglib2.0-0
|
||||||
|
sudo apt -y install python3-gi libgirepository1.0-dev # should pull dependencies for gi installation below
|
||||||
|
- name: Get a recent python
|
||||||
|
uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: '3.9'
|
||||||
|
- name: Install build-time dependencies
|
||||||
|
run: |
|
||||||
|
echo "PYTHON=python3.9" >> $GITHUB_ENV
|
||||||
|
wget -nv https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage
|
||||||
|
chmod a+rx appimagetool-x86_64.AppImage
|
||||||
|
./appimagetool-x86_64.AppImage --appimage-extract
|
||||||
|
echo -e '#/bin/sh\n./squashfs-root/AppRun "$@"' > appimagetool
|
||||||
|
chmod a+rx appimagetool
|
||||||
|
- name: Download run-time dependencies
|
||||||
|
run: |
|
||||||
|
wget -nv https://github.com/black-sliver/sni/releases/download/v0.0.78-2/sni-v0.0.78-2-manylinux2014-amd64.tar.xz
|
||||||
|
tar xf sni-*.tar.xz
|
||||||
|
rm sni-*.tar.xz
|
||||||
|
mv sni-* SNI
|
||||||
|
wget -nv https://github.com/Ijwu/Enemizer/releases/download/6.4/ubuntu.16.04-x64.7z
|
||||||
|
7za x -oEnemizerCLI/ ubuntu.16.04-x64.7z
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
"${{ env.PYTHON }}" -m pip install --upgrade pip setuptools virtualenv PyGObject # pygobject should probably move to requirements
|
||||||
|
"${{ env.PYTHON }}" -m venv venv
|
||||||
|
source venv/bin/activate
|
||||||
|
pip install -r requirements.txt
|
||||||
|
python setup.py build --yes bdist_appimage --yes
|
||||||
|
echo -e "setup.py build output:\n `ls build`"
|
||||||
|
echo -e "setup.py dist output:\n `ls dist`"
|
||||||
|
cd dist && export APPIMAGE_NAME="`ls *.AppImage`" && cd ..
|
||||||
|
export TAR_NAME="${APPIMAGE_NAME%.AppImage}.tar.gz"
|
||||||
|
(cd build && DIR_NAME="`ls | grep exe`" && mv "$DIR_NAME" Archipelago && tar -czvf ../dist/$TAR_NAME Archipelago && mv Archipelago "$DIR_NAME")
|
||||||
|
echo "APPIMAGE_NAME=$APPIMAGE_NAME" >> $GITHUB_ENV
|
||||||
|
echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV
|
||||||
|
# - code above copied from build.yml -
|
||||||
|
- name: Add to Release
|
||||||
|
uses: softprops/action-gh-release@b7e450da2a4b4cb4bfbae528f788167786cfcedf
|
||||||
|
with:
|
||||||
|
draft: true # see above
|
||||||
|
prerelease: false
|
||||||
|
name: Archipelago ${{ env.RELEASE_VERSION }}
|
||||||
|
files: |
|
||||||
|
dist/*
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
Loading…
Reference in New Issue