Update build.yml
This commit is contained in:
parent
137b13c706
commit
25a106c420
1 changed files with 53 additions and 2 deletions
55
.github/workflows/build.yml
vendored
55
.github/workflows/build.yml
vendored
|
|
@ -28,8 +28,59 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
pip install -r requirements.txt
|
||||||
pip install -U pyinstaller
|
pip install -U pyinstaller
|
||||||
- name: Build with PyInstaller
|
- name: Build with PyInstaller
|
||||||
run: |
|
run: |
|
||||||
pyinstaller -D -F -n generate -c ./generate.py
|
pyinstaller -D -F -n generate -c -n MOTD-${{matrix.os}} ./generate.py
|
||||||
|
- name: Create Release
|
||||||
|
uses: actions/github-script@v2
|
||||||
|
with:
|
||||||
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
script: |
|
||||||
|
console.log('environment', process.versions)
|
||||||
|
const fs = require('fs').promises;
|
||||||
|
|
||||||
|
const { repo: { owner, repo }, sha } = context;
|
||||||
|
console.log({ owner, repo, sha });
|
||||||
|
|
||||||
|
const release = await github.repos.createRelease({
|
||||||
|
owner, repo,
|
||||||
|
tag_name: process.env.GITHUB_REF,
|
||||||
|
prerelease: true,
|
||||||
|
target_commitish: sha
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log('created release', { release });
|
||||||
|
|
||||||
|
for (let file of await fs.readdir('./dist')) {
|
||||||
|
console.log('uploading', file);
|
||||||
|
|
||||||
|
await github.repos.uploadReleaseAsset({
|
||||||
|
owner, repo,
|
||||||
|
release_id: release.data.id,
|
||||||
|
name: file,
|
||||||
|
data: await fs.readFile(`./${file}`)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
# - name: Create Release
|
||||||
|
# id: create_release
|
||||||
|
# uses: actions/create-release@v1
|
||||||
|
# env:
|
||||||
|
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
# with:
|
||||||
|
# tag_name: ${{github.ref}}
|
||||||
|
# release_name: Dev Release ${{github.ref}}
|
||||||
|
# prerelease: true
|
||||||
|
# - name: Upload Release Artifact
|
||||||
|
# id: 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: ./dist/MOTD-${{matrix.os}}.exe
|
||||||
|
# asset_name: MOTD ${{ matrix.os }}
|
||||||
|
# asset_content_type: a[[;ocatopm
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue