-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (85 loc) · 3.35 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# 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
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, pillow and boto3
run: |
pip install PyDrive
pip install pillow
pip install boto3
- 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 }}
AWS_S3_ACCESS_KEY: ${{ secrets.AWS_S3_ACCESS_KEY }}
AWS_S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
FILE_REPOSITORY: ${{ secrets.FILE_REPOSITORY }}
- name: push translation
run: |
dir
git config --global user.email "matanki.saito@gmail.com"
git config --global user.name "matanki.saito"
git config --global url."https://${{ secrets.GITHUB_TOKEN }}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
git add -A
git commit -m "Save/Update files [ci skip]"
git push origin HEAD:main
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