update release notes #37
Workflow file for this run
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: Release build | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Create Version file | |
run: | | |
echo VERSION = \"`git describe --always --abbrev=8 --dirty --tags`\" > version.py | |
echo RELEASE=True >> version.py | |
- name: Package Application | |
uses: walmis/pyinstaller-action-windows@py311 | |
with: | |
path: . | |
- name: Make Zip | |
id: zip | |
run: | | |
cd dist/windows/VPforce-TelemFFB && zip -r ../../../VPforce-TelemFFB . | |
echo "::set-output name=tag_name::$(git tag --sort version:refname | tail -n 1)" | |
- name: Extract latest release notes | |
run: | | |
pattern='(?s)############################################\n##.*?\n############################################\n((.|\n)*?)\n############################################\n' | |
python -c "import re; print(re.search('$pattern', open('_RELEASE_NOTES.txt').read()).groups()[0])" > latest_release_notes.txt | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body_path: latest_release_notes.txt | |
draft: false | |
prerelease: false | |
- name: upload windows artifact | |
id: upload_release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: VPforce-TelemFFB.zip | |
asset_name: VPforce-TelemFFB-${{ steps.zip.outputs.tag_name }}.zip | |
asset_content_type: application/zip | |
- name: update latest.json | |
run: | | |
commit_id=$(git describe --always --abbrev=8 --tags) | |
branch_name=$(git rev-parse --abbrev-ref HEAD) | |
filename=VPforce-TelemFFB-${{ steps.zip.outputs.tag_name }}.zip | |
echo "{ \"url\" : \"${{ steps.upload_release.outputs.browser_download_url }}\", \"filename\" : \"${filename}\", \"date\": \"`date -Iseconds`\", \"version\": \"${commit_id}\" }" > latest.json | |
cat latest.json | |
mv VPforce-TelemFFB.zip VPforce-TelemFFB-${{ steps.zip.outputs.tag_name }}.zip | |
- name: Deploy to Server | |
uses: easingthemes/ssh-deploy@main | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
ARGS: "-v" | |
SOURCE: "VPforce-TelemFFB*.zip latest.json" | |
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | |
REMOTE_USER: ${{ secrets.REMOTE_USER }} | |
TARGET: ${{ secrets.REMOTE_TARGET }} | |
#EXCLUDE: "/dist/, /node_modules/" |