publish #292
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: publish | |
on: | |
repository_dispatch: | |
types: [publish] | |
workflow_dispatch: | |
inputs: | |
name: | |
description: 'Description' | |
required: false | |
jobs: | |
build: | |
runs-on: windows-2019 | |
if: "! contains(github.event.head_commit.message, '[ci skip]')" | |
strategy: | |
matrix: | |
python-version: [ 3.8 ] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Update pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install PyDrive and pillow | |
run: | | |
pip install PyDrive | |
pip install pillow | |
- name: Install secure file | |
env: # Or as an environment variable | |
SETTINGS_YAML: ${{ secrets.SETTINGS_YAML }} | |
CREDENTIALS_JSON: ${{ secrets.CREDENTIALS_JSON }} | |
run: | | |
python env2file.py | |
dir | |
type credentials.json | |
type settings.yaml | |
shell: cmd | |
- name: Pack mod and upload | |
id: create_mod | |
run: | | |
python main.py | |
env: | |
PARATRANZ_SECRET: ${{ secrets.PARATRANZ_SECRET }} | |
- name: push translation | |
run: | | |
dir | |
git config --global user.email "[email protected]" | |
git config --global user.name "matanki.saito" | |
git config --global url."https://${{ secrets.GITHUB_TOKEN }}:[email protected]/".insteadOf "https://github.com/" | |
git add -A | |
git commit -m "Save/Update files [ci skip]" | |
git push origin HEAD:master | |
shell: cmd | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
- 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.run_number }} | |
release_name: Release ${{ github.run_number }} | |
body: | | |
new mod released! | |
URL: ${{ steps.create_mod.outputs.download_url }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
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 }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
asset_path: ./out/dist.v2.json | |
asset_name: dist.v2.json | |
asset_content_type: application/json | |