-
Notifications
You must be signed in to change notification settings - Fork 62
GitHub Actions workflow
This is a guide on how to set up a GitHub workflow to run the packager automatically for your AddOns hosted on GitHub.
Only parts relevant to the packager project will be detailed here. For the full know-how on workflows, you can refer to the GitHub Docs and their docs for the full workflow syntax.
All of this can be done directly on GitHub, by clicking "Actions" on the project page for your AddOn, then "Skip this and set up a workflow yourself". You can also just create a file (e.g., .github/workflows/release.yml
) in your project directory and edit that if you prefer using your own tools.
The example below should be pretty self-explanatory. It's written in YAML, and aside from the annotations provided, the only thing to keep in mind are the environment variables needed to upload the packaged AddOn archive. These environment variables are detailed in the README, and need to be stored as "secrets" on your GitHub project page. Please follow this GitHub documentation on how to do that.
Important: The automatically-generated GITHUB_TOKEN
secret must be configured with read-write permissions for your own repository to permit the packager to publish releases. Failure to do so will result in "Resource not accessible by integration" errors.
Annotated workflow example:
# description of this workflow, can be anything you want
name: Package and release
# we need to let GitHub know _when_ we want to release.
# this is typically only when we create a new tag.
# make sure your tags are annotated!
on:
push:
tags:
- '**'
# a workflow is built up as jobs, and within these jobs are steps
jobs:
# "release" is a job, you can name it anything you want
release:
# we can run our steps on pretty much anything, but the "ubuntu-latest" image is a safe bet
runs-on: ubuntu-latest
# specify the environment variables used by the packager, matching the secrets for the project on GitHub
env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
WOWI_API_TOKEN: ${{ secrets.WOWI_API_TOKEN }}
WAGO_API_TOKEN: ${{ secrets.WAGO_API_TOKEN }}
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} # this secret is pre-provided for the workflow and does not
# need to be added yourself, we just reference it here.
# "steps" holds a list of all the steps needed to package and release our AddOn
steps:
# we first have to clone the AddOn project, this is a required step
- name: Clone project
uses: actions/checkout@v4
with:
fetch-depth: 0 # gets entire git history, needed for automatic changelogs
# once cloned, we just run the GitHub Action
- name: Package and release
uses: BigWigsMods/packager@v2
# another example where we supply additional arguments, this example is specifically to release
# for the Wrath of the Lich King Classic version of the game and doesn't upload to WoWInterface
- name: Package and release for Wrath of the Lich King Classic
uses: BigWigsMods/packager@v2
with:
args: -g wrath -w 0
That's it, feel free to open an issue and tag @p3lim if you have questions or issues specifically related to this.