|
1 | 1 | # This is a basic workflow to help you get started with Actions |
2 | 2 |
|
3 | | -name: BuildEditor |
| 3 | +name: Godot Build PC Release |
4 | 4 |
|
5 | | -# Controls when the action will run. Triggers the workflow on push or pull request |
6 | | -# events but only for the master branch |
| 5 | +# Controls when the action will run. |
7 | 6 | on: |
| 7 | + # Triggers the workflow on push or pull request events but only for the master branch |
8 | 8 | push: |
9 | | - paths-ignore: |
10 | | - - 'editor_version.txt' |
| 9 | + branches: [ master ] |
11 | 10 | pull_request: |
12 | 11 | branches: [ master ] |
| 12 | + |
13 | 13 | # Allows you to run this workflow manually from the Actions tab |
14 | 14 | workflow_dispatch: |
15 | | -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 15 | + |
16 | 16 | jobs: |
17 | 17 | # This workflow contains a single job called "build" |
18 | | - build: |
| 18 | + godot-build: |
19 | 19 | # The type of runner that the job will run on |
20 | 20 | runs-on: ubuntu-latest |
21 | 21 |
|
22 | 22 | # Steps represent a sequence of tasks that will be executed as part of the job |
23 | 23 | steps: |
24 | 24 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
25 | 25 | - uses: actions/checkout@v2 |
26 | | - - name: Calculate GIT short ref |
| 26 | + # Runs a set of commands using the runners shell |
| 27 | + - name: Declare some variables |
| 28 | + id: vars |
| 29 | + shell: bash |
27 | 30 | run: | |
28 | | - echo "GITHUB_SHA_SHORT=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV |
29 | | - - name: Update game_version.txt file # transfer the new html files back into the repository |
| 31 | + echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" |
| 32 | + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" |
| 33 | + - name: Download Godot and export templates |
30 | 34 | run: | |
31 | | - echo ${{ env.GITHUB_SHA_SHORT }} > editor_version.txt |
32 | | - git config --local user.name "Github Actions" |
33 | | - git config --local user.email "githubactions@github.com" |
34 | | - git add editor_version.txt |
35 | | - git commit -m "Updating game verion file..." |
36 | | - - name: Push changes # push the output folder to your repo |
37 | | - uses: ad-m/github-push-action@master |
38 | | - with: |
39 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
40 | | - force: true |
41 | | - #- name: Write Version to File |
42 | | - # You may pin to the exact commit or the version. |
43 | | - # uses: brettdorrans/write-version-to-file@ea48c38c3afc479e8b2645a19743c24200966f3d |
44 | | - # uses: brettdorrans/write-version-to-file@v1.0.0 |
45 | | - #with: |
46 | | - # The filename to write the version tag to |
47 | | - #filename: game_version.txt |
48 | | - - name: Build for Linux 32-bit |
49 | | - # You may pin to the exact commit or the version. |
50 | | - # uses: josephbmanley/build-godot-action@5206884b2f984e37d89c07e535590129a29eb182 |
51 | | - uses: josephbmanley/build-godot-action@v1.4.1 |
52 | | - with: |
53 | | - # Name of the exported binary |
54 | | - name: FoxyAdventureLevelEditor.32 |
55 | | - # Name of the preset in `export_presets.cfg` to use |
56 | | - preset: x11-32 |
57 | | - # Optional name of the subdirectory to put exported project in |
58 | | - subdirectory: build-x11-32 |
59 | | - # Set true to output an artifact zip file |
60 | | - package: false |
61 | | - projectDir: ./ |
62 | | - # Runs a single command using the runners shell |
63 | | - - name: Build for Linux 64-bit |
64 | | - # You may pin to the exact commit or the version. |
65 | | - # uses: josephbmanley/build-godot-action@5206884b2f984e37d89c07e535590129a29eb182 |
66 | | - uses: josephbmanley/build-godot-action@v1.4.1 |
67 | | - with: |
68 | | - # Name of the exported binary |
69 | | - name: FoxyAdventureLevelEditor.64 |
70 | | - # Name of the preset in `export_presets.cfg` to use |
71 | | - preset: x11-64 |
72 | | - # Optional name of the subdirectory to put exported project in |
73 | | - subdirectory: build-x11-64 |
74 | | - # Set true to output an artifact zip file |
75 | | - package: false |
76 | | - projectDir: ./ |
77 | | - # Whether or not to use `--export-debug` |
78 | | - - name: Build for Windows 32-bit |
79 | | - # You may pin to the exact commit or the version. |
80 | | - # uses: josephbmanley/build-godot-action@5206884b2f984e37d89c07e535590129a29eb182 |
81 | | - uses: josephbmanley/build-godot-action@v1.4.1 |
82 | | - with: |
83 | | - # Name of the exported binary |
84 | | - name: FoxyAdventureLevelEditor.exe |
85 | | - # Name of the preset in `export_presets.cfg` to use |
86 | | - preset: win-32 |
87 | | - # Optional name of the subdirectory to put exported project in |
88 | | - subdirectory: build-win-32 |
89 | | - # Set true to output an artifact zip file |
90 | | - package: false |
91 | | - projectDir: ./ |
92 | | - # Whether or not to use `--export-debug` |
93 | | - - name: Build for Windows 64-bit |
94 | | - # You may pin to the exact commit or the version. |
95 | | - # uses: josephbmanley/build-godot-action@5206884b2f984e37d89c07e535590129a29eb182 |
96 | | - uses: josephbmanley/build-godot-action@v1.4.1 |
97 | | - with: |
98 | | - # Name of the exported binary |
99 | | - name: FoxyAdventureLevelEditor.exe |
100 | | - # Name of the preset in `export_presets.cfg` to use |
101 | | - preset: win-64 |
102 | | - # Optional name of the subdirectory to put exported project in |
103 | | - subdirectory: build-win-64 |
104 | | - # Set true to output an artifact zip file |
105 | | - package: false |
106 | | - projectDir: ./ |
107 | | - # Whether or not to use `--export-debug` |
108 | | - - name: Build for Mac OS X |
109 | | - # You may pin to the exact commit or the version. |
110 | | - # uses: josephbmanley/build-godot-action@5206884b2f984e37d89c07e535590129a29eb182 |
111 | | - uses: josephbmanley/build-godot-action@v1.4.1 |
112 | | - with: |
113 | | - # Name of the exported binary |
114 | | - name: FoxyAdventureLevelEditor.zip |
115 | | - # Name of the preset in `export_presets.cfg` to use |
116 | | - preset: osx |
117 | | - # Optional name of the subdirectory to put exported project in |
118 | | - subdirectory: build-osx |
119 | | - # Set true to output an artifact zip file |
120 | | - package: false |
121 | | - projectDir: ./ |
122 | | - # Whether or not to use `--export-debug` |
123 | | - - name: ZIP Release |
124 | | - env: |
125 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 35 | + sudo apt install unzip |
| 36 | + sudo apt install tree |
| 37 | + echo *** Downloading Godot Binary *** |
| 38 | + wget https://downloads.tuxfamily.org/godotengine/3.2.4/rc1/Godot_v3.2.4-rc1_linux_headless.64.zip |
| 39 | + echo *** Downloading Godot Server Export Templates *** |
| 40 | + wget https://downloads.tuxfamily.org/godotengine/3.2.4/rc1/Godot_v3.2.4-rc1_export_templates.tpz |
| 41 | + echo *** Unzipping Godot Binary *** |
| 42 | + unzip Godot_v3.2.4-rc1_linux_headless.64.zip |
| 43 | + echo *** Unzipping Godot Server Export Templates *** |
| 44 | + unzip Godot_v3.2.4-rc1_export_templates.tpz |
| 45 | + echo *** Installing Godot Server Export Templates *** |
| 46 | + cd /home/runner/ |
| 47 | + sudo mkdir -p .local/share/godot |
| 48 | + cd .local/share/godot |
| 49 | + sudo mkdir -p templates/3.2.4.rc1 |
| 50 | + sudo cp -r $GITHUB_WORKSPACE/templates/* templates/3.2.4.rc1 |
| 51 | + echo *** Exporting Files *** |
| 52 | + cd $GITHUB_WORKSPACE |
| 53 | + sudo mkdir -p builds/{x11-32-standard,x11-64-standard,win-32-standard,win-64-standard,osx-standard} |
| 54 | + - name: Export x11-64 |
| 55 | + run: | |
| 56 | + sudo ./Godot_v3.2.4-rc1_linux_headless.64 --path "." --export "x11-64" $GITHUB_WORKSPACE/builds/x11-64-standard/FALevelEditor.x86_64 |
| 57 | + - name: Export x11-32 |
| 58 | + run: | |
| 59 | + sudo ./Godot_v3.2.4-rc1_linux_headless.64 --path "." --export "x11-32" $GITHUB_WORKSPACE/builds/x11-32-standard/FALevelEditor.x86 |
| 60 | + - name: Export osx |
126 | 61 | run: | |
127 | | - zip -r build-x11-32.zip build/build-x11-32 |
128 | | - zip -r build-x11-64.zip build/build-x11-64 |
129 | | - zip -r build-win-32.zip build/build-win-32 |
130 | | - zip -r build-win-64.zip build/build-win-64 |
131 | | - - name: Release snapshot |
132 | | - id: release-snapshot |
133 | | - uses: actions/create-release@latest |
| 62 | + sudo ./Godot_v3.2.4-rc1_linux_headless.64 --path "." --export "osx" $GITHUB_WORKSPACE/builds/osx-standard/FALevelEditor.zip |
| 63 | + - name: Export win-32 |
| 64 | + run: | |
| 65 | + sudo ./Godot_v3.2.4-rc1_linux_headless.64 --path "." --export "win-32" $GITHUB_WORKSPACE/builds/win-32-standard/FALevelEditor.exe |
| 66 | + - name: Export win-64 |
| 67 | + run: | |
| 68 | + sudo ./Godot_v3.2.4-rc1_linux_headless.64 --path "." --export "win-64" $GITHUB_WORKSPACE/builds/win-64-standard/FALevelEditor.exe |
| 69 | + tree -a |
| 70 | + - name: ZIP Builds |
| 71 | + run: | |
| 72 | + cd $GITHUB_WORKSPACE/builds/win-64-standard |
| 73 | + sudo zip build-win-64.zip * |
| 74 | + cd $GITHUB_WORKSPACE/builds/win-32-standard |
| 75 | + sudo zip build-win-32.zip * |
| 76 | + cd $GITHUB_WORKSPACE/builds/x11-64-standard |
| 77 | + sudo zip build-x11-64.zip * |
| 78 | + cd $GITHUB_WORKSPACE/builds/x11-32-standard |
| 79 | + sudo zip build-x11-32.zip * |
| 80 | + cd $GITHUB_WORKSPACE/builds/osx-standard |
| 81 | + sudo zip build-osx-64.zip * |
| 82 | + - name: Create Release |
| 83 | + id: create_release |
| 84 | + uses: actions/create-release@v1 |
134 | 85 | env: |
135 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 86 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
136 | 87 | with: |
137 | | - tag_name: ${{ env.GITHUB_SHA_SHORT }} |
138 | | - release_name: Release from ${{ env.GITHUB_SHA_SHORT }} commit |
| 88 | + tag_name: ${{ steps.vars.outputs.sha_short }} |
| 89 | + release_name: Release ${{ steps.vars.outputs.sha_short }} |
139 | 90 | draft: false |
140 | 91 | prerelease: false |
141 | | - - name: Upload Release Asset (Linux 32-bit) |
| 92 | + - name: Upload Release Asset - x11-64 |
| 93 | + id: upload-release-asset-x1164 |
142 | 94 | uses: actions/upload-release-asset@v1 |
143 | 95 | env: |
144 | 96 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
145 | 97 | with: |
146 | | - upload_url: ${{ steps.release-snapshot.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 |
147 | | - asset_path: ./build-x11-32.zip |
148 | | - asset_name: build-x11-32.zip |
| 98 | + 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 |
| 99 | + asset_path: builds/x11-64-standard/build-x11-64.zip |
| 100 | + asset_name: build-x11-64.zip |
149 | 101 | asset_content_type: application/zip |
150 | | - - name: Upload Release Asset (Linux 64-bit) |
| 102 | + - name: Upload Release Asset - x11-32 |
| 103 | + id: upload-release-asset-x1132 |
151 | 104 | uses: actions/upload-release-asset@v1 |
152 | 105 | env: |
153 | 106 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
154 | 107 | with: |
155 | | - upload_url: ${{ steps.release-snapshot.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 |
156 | | - asset_path: ./build-x11-64.zip |
157 | | - asset_name: build-x11-64.zip |
| 108 | + 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 |
| 109 | + asset_path: builds/x11-32-standard/build-x11-32.zip |
| 110 | + asset_name: build-x11-32.zip |
158 | 111 | asset_content_type: application/zip |
159 | | - - name: Upload Release Asset (Windows 32-bit) |
| 112 | + - name: Upload Release Asset - osx-64 |
| 113 | + id: upload-release-asset-osx64 |
160 | 114 | uses: actions/upload-release-asset@v1 |
161 | 115 | env: |
162 | 116 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
163 | 117 | with: |
164 | | - upload_url: ${{ steps.release-snapshot.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 |
165 | | - asset_path: ./build-win-32.zip |
166 | | - asset_name: build-win-32.zip |
| 118 | + 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 |
| 119 | + asset_path: builds/osx-standard/build-osx-64.zip |
| 120 | + asset_name: build-osx-64.zip |
167 | 121 | asset_content_type: application/zip |
168 | | - - name: Upload Release Asset (Windows 64-bit) |
| 122 | + - name: Upload Release Asset - win-32 |
| 123 | + id: upload-release-asset-win32 |
169 | 124 | uses: actions/upload-release-asset@v1 |
170 | 125 | env: |
171 | 126 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
172 | 127 | with: |
173 | | - upload_url: ${{ steps.release-snapshot.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 |
174 | | - asset_path: ./build-win-64.zip |
175 | | - asset_name: build-win-64.zip |
| 128 | + 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 |
| 129 | + asset_path: builds/win-32-standard/build-win-32.zip |
| 130 | + asset_name: build-win-32.zip |
176 | 131 | asset_content_type: application/zip |
177 | | - - name: Upload Release Asset (Mac OS X) |
| 132 | + - name: Upload Release Asset - win-64 |
| 133 | + id: upload-release-asset-win64 |
178 | 134 | uses: actions/upload-release-asset@v1 |
179 | 135 | env: |
180 | 136 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
181 | 137 | with: |
182 | | - upload_url: ${{ steps.release-snapshot.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 |
183 | | - asset_path: build/build-osx/FoxyAdventureLevelEditor.zip |
184 | | - asset_name: build-osx.zip |
| 138 | + 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 |
| 139 | + asset_path: builds/win-64-standard/build-win-64.zip |
| 140 | + asset_name: build-win-64.zip |
185 | 141 | asset_content_type: application/zip |
0 commit comments