andy5995 Posted September 23, 2022 Report Share Posted September 23, 2022 I've made a GitHub action that builds a pyromod. It does it using the 'pyrogenesis' archive builder so converts the textures and stuff. 4 Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 23, 2022 Report Share Posted September 23, 2022 Nice! 1 Quote Link to comment Share on other sites More sharing options...
andy5995 Posted September 24, 2022 Author Report Share Posted September 24, 2022 The Dockerfile I'm using for the Action is at 0ad-matters/0ad-bin-nodata Quote Link to comment Share on other sites More sharing options...
smiley Posted September 24, 2022 Report Share Posted September 24, 2022 Perhaps a brief tutorial on this thread is warranted for those unfamiliar with Github actions. 1 Quote Link to comment Share on other sites More sharing options...
andy5995 Posted September 25, 2022 Author Report Share Posted September 25, 2022 20 hours ago, smiley said: Perhaps a brief tutorial on this thread is warranted for those unfamiliar with Github actions. I can try to make things a bit more clear, but I'm not sure a tutorial is warranted at this point. There's already docs on building a pyromod, github actions, and docker. So... this thread is intended for anyone who hosts a mod on GitHub and want a bit of convenience when doing a release. Or this thread is intended for anyone thinking about hosing a mod on GitHub. People who don't use GitHub to mod will have no use for this action and can safely ignore this thread. The docs for using the Action on the repo README. It assumes the root directory of your mod is in the repo root (e.g., the repo root is where 'mod.json' is located) When the action runs, it will create the mod using the pyrogenesis archive builder as shown here, and output the resulting .pyromod file to $PWD/output. An example is shown on the README on how to access it so it can be used in a separate release action. The release action shown in the example is not required to use the gh-action-build-pyromod action (there are other release actions available on GitHub that can be used instead, if you prefer) 20 hours ago, andy5995 said: The Dockerfile I'm using for the Action is at 0ad-matters/0ad-bin-nodata No technical knowledge of Docker is needed to use the Action. I posted this for anyone who is curious about the docker image used "behind-the-scenes" for the action, or for anyone who wants to "audit" how the image is created, or make a PR to improve upon it. I'd be happy to answer any specific questions related to the Action. How's that @smiley? Quote Link to comment Share on other sites More sharing options...
andy5995 Posted September 25, 2022 Author Report Share Posted September 25, 2022 I've also updated the README with some extra info. Thanks for the suggestion @smiley 2 Quote Link to comment Share on other sites More sharing options...
Kampot Posted September 26, 2022 Report Share Posted September 26, 2022 I think i got lost in so m any link and not sure what to do, (sorry im new to github and never used this things so maybe "more newbie text would be great" My understanding is this should create pyromod from provided source somehow automatically. I created mentioned yml file https://github.com/Kampot-0ad/customrating/blob/main/.github/workflows/create_pyromod.yml Now I can see in "action" menu new workflow "Build Pyromod" but no idea how to execute it. Questions: - Do I need to edit anything in "Releases" or "Packages"? There is Publish your first package Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 26, 2022 Report Share Posted September 26, 2022 You need to add a tag e.g v0.26.0 to one of your commits, and it'll run automatically. 2 Quote Link to comment Share on other sites More sharing options...
Kampot Posted September 26, 2022 Report Share Posted September 26, 2022 ok i made it but now in action is this failure Quote Link to comment Share on other sites More sharing options...
Stan` Posted September 26, 2022 Report Share Posted September 26, 2022 You only have v0.26.1 as tag so you need to use that. Quote Link to comment Share on other sites More sharing options...
Kampot Posted September 26, 2022 Report Share Posted September 26, 2022 10 minutes ago, Stan` said: You only have v0.26.1 as tag so you need to use that. Does not ring the bell, it seems to me it tries to use some "uses" outside of my github. my product tags does not matter I guess otherwise this automation would not make sense. name: Release PyroMod uses: ncipollo/release-action@v1.1 <--- HERE IS PROBLEM with: allowUpdates: True prerelease: False artifacts: "output/${{ env.MOD_NAME }}*.*" token: ${{ secrets.GITHUB_TOKEN }} omitNameDuringUpdate: True omitBodyDuringUpdate: True Quote Link to comment Share on other sites More sharing options...
andy5995 Posted September 26, 2022 Author Report Share Posted September 26, 2022 49 minutes ago, Kampot said: Does not ring the bell, it seems to me it tries to use some "uses" outside of my github. my product tags does not matter I guess otherwise this automation would not make sense. @KampotI made a couple mistakes in my docs. The release action should be 'ncipollo/release-action@v1` not `ncipollo/release-action@v1.1` Quote Link to comment Share on other sites More sharing options...
Kampot Posted September 26, 2022 Report Share Posted September 26, 2022 It works, thanks. Now I would love to understand how it really works 1 Quote Link to comment Share on other sites More sharing options...
andy5995 Posted September 26, 2022 Author Report Share Posted September 26, 2022 @KampotI'm glad you got it working! 5 hours ago, Kampot said: It works, thanks. Now I would love to understand how it really works Since you're new to GitHub, I can understand how it could be confusing. It's the very first github action I made, and I've been using GitHub for several years. I know you've already looked at the files in the build-pyromod repo. If you look at some of the links in the README, it might help you understand better. They key element is the use of docker with the action. Note that Docker isn't required to make an action, but it can be very helpful. If at some point you have some specific questions about how it's done, feel free to post here. Good luck! Quote Link to comment Share on other sites More sharing options...
andy5995 Posted October 7, 2022 Author Report Share Posted October 7, 2022 1.x.x releases will point to v1 from now on. So your "uses" line should look like `- uses: 0ad-matters/gh-action-build-pyromod@v1` until v2 is released. https://michaelheap.com/semantic-versioning-for-github-actions/ https://github.com/actions/toolkit/blob/master/docs/action-versioning.md#versioning Quote Link to comment Share on other sites More sharing options...
andy5995 Posted October 8, 2022 Author Report Share Posted October 8, 2022 (edited) I've updated the example. Using this, the mod will build when you push any new commits to your main (default) branch, or any time a pull request is opened or updated. The artifact will get uploaded to the workflow output page (where you can download it and inspect it if desired). You can see at this link near the top right: Quote Artifacts 1 And at the bottom of the page is a zip file containing the mod (artifact). If the event that triggered the workflow is the creation of a tag starting with 'v', the pyromod gets built and uploaded to the release page (behavior that was in the original example). name: Build Pyromod on: push: branches: - main tags: - v** pull_request: branches: - main env: MOD_NAME: <your-mod> jobs: build-pyromod: if: ${{ github.ref_type != 'tag' }} runs-on: ubuntu-latest env: MOD_VERSION: ${{ github.sha }} steps: - uses: actions/checkout@v3 - uses: 0ad-matters/gh-action-build-pyromod@v1 with: name: ${{ env.MOD_NAME }} version: ${{ env.MOD_VERSION }} id: build-pyromod - name: Upload Artifacts # Uploads artifacts (combined into a zip file) to the workflow output page uses: actions/upload-artifact@v3 with: name: ${{ env.MOD_NAME }}-${{ env.MOD_VERSION }} path: "output/${{ env.MOD_NAME }}*.*" release-pyromod: if: ${{ github.ref_type == 'tag' }} runs-on: ubuntu-latest env: MOD_VERSION: ${{ github.ref_name }} steps: - uses: actions/checkout@v3 - name: Massage Variables run: | echo "MOD_VERSION=${MOD_VERSION:1}" >> $GITHUB_ENV - uses: 0ad-matters/gh-action-build-pyromod@v1 with: name: ${{ env.MOD_NAME }} version: ${{ env.MOD_VERSION }} id: build-pyromod - name: Create sha256sum run: | OUTPUT_FILE="$MOD_NAME-$MOD_VERSION.pyromod" cd output sha256sum $OUTPUT_FILE > $OUTPUT_FILE.sha256sum - name: Release PyroMod uses: ncipollo/release-action@v1 with: allowUpdates: True prerelease: False artifacts: "output/${{ env.MOD_NAME }}*.*" token: ${{ secrets.GITHUB_TOKEN }} omitNameDuringUpdate: True omitBodyDuringUpdate: True Edited October 10, 2022 by andy5995 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.