Update test.yaml #159
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: Automated test build | |
on: | |
push: | |
branches: | |
- 'wip' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Specific Setuptools Version | |
run: | | |
python -m pip install setuptools==71.1.0 # Avoid issue https://github.com/pypa/setuptools/issues/4518 in v72.x | |
- name: Create Version file | |
run: | | |
echo VERSION = \"`git describe --always --abbrev=8 --dirty --tags`\" > version.py | |
echo RELEASE=False >> version.py | |
- name: Package Application | |
uses: walmis/pyinstaller-action-windows@py311 | |
with: | |
path: . | |
- name: Make Zip | |
id: zip | |
run: | | |
commit_id=$(git describe --always --abbrev=8 --tags) | |
branch_name=$(git rev-parse --abbrev-ref HEAD) | |
zip_filename="VPforce-TelemFFB-${branch_name}-${commit_id}.zip" | |
echo "{ \"filename\" : \"${zip_filename}\", \"date\": \"`date -Iseconds`\", \"version\": \"${commit_id}\" }" > latest_dev.json | |
cd dist/windows/VPforce-TelemFFB && zip -r "../../../${zip_filename}" . | |
echo "BRANCH_NAME=${branch_name}" >> $GITHUB_ENV | |
echo "ZIP_FILENAME=${zip_filename}" >> $GITHUB_ENV | |
- uses: actions/upload-artifact@v4 | |
with: | |
# Name of the artifact to upload. | |
# Optional. Default is 'artifact' | |
name: build | |
# A file, directory or wildcard pattern that describes what to upload | |
# Required. | |
path: ${{ env.ZIP_FILENAME }} | |
- name: Deploy to Server | |
uses: easingthemes/ssh-deploy@main | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
ARGS: "-v" | |
SOURCE: "VPforce-TelemFFB*.zip latest_dev.json" | |
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | |
REMOTE_USER: ${{ secrets.REMOTE_USER }} | |
TARGET: ${{ secrets.REMOTE_TARGET }} | |
#EXCLUDE: "/dist/, /node_modules/" | |
- name: Invoke webhook | |
uses: joelwmale/webhook-action@master | |
with: | |
url: ${{ secrets.WEBHOOK_URL }} | |
#headers: '{"repository": "joelwmale/webhook-action"}' | |
body: '{"content": "🛠️ New Dev Build Published: https://vpforce.eu/downloads/TelemFFB/${{ env.ZIP_FILENAME }}" }' |