Add packages from Simtropolis #1075
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
name: Add packages from Simtropolis | |
on: | |
workflow_dispatch: | |
inputs: | |
url: | |
description: URL or file id | |
required: false | |
require-metadata: | |
description: Require metadata.yaml | |
type: boolean | |
default: true | |
schedule: | |
- cron: '32 * * * *' | |
jobs: | |
add-packages: | |
runs-on: ubuntu-latest | |
permissions: write-all | |
# Allow only one concurrent deployment, skipping runs queued between the run | |
# in-progress and latest queued. However, do NOT cancel in-progress runs as | |
# we want to allow these production deployments to complete. | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: false | |
env: | |
SC4PAC_SIMTROPOLIS_COOKIE: ${{ secrets.SC4PAC_SIMTROPOLIS_COOKIE }} | |
STEX_API_KEY: ${{ secrets.STEX_API_KEY }} | |
GITHUB_OWNER: ${{ github.repository_owner }} | |
GITHUB_REPO: ${{ github.event.repository.name }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
LAST_RUN_TOKEN: ${{ secrets.LAST_RUN_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Git | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: package.json | |
- run: npm ci | |
- name: Fetch updated packages from Simtropolis | |
id: fetch | |
uses: ./actions/fetch | |
with: | |
url: ${{ github.event.inputs.url }} | |
after: ${{ vars.LAST_RUN }} | |
require-metadata: ${{ github.events.inputs.require-metadata }} | |
- name: Setup linter | |
if: steps.fetch.outputs.has-new-content == 'true' | |
uses: memo33/sc4pac-actions/actions/setup-lint@main | |
- name: Create & update PRs | |
if: steps.fetch.outputs.has-new-content == 'true' | |
id: create-prs | |
uses: ./actions/create-prs | |
with: | |
channel-url: https://sc4pac.simtropolis.com | |
channel-name: Simtropolis channel | |
packages: ${{ steps.fetch.outputs.packages }} | |
timestamp: ${{ steps.fetch.outputs.timestamp }} | |
- name: Send DMs on Simtropolis | |
if: steps.fetch.outputs.has-new-content == 'true' | |
uses: ./actions/send-messages | |
with: | |
messages: ${{ steps.create-prs.outputs.messages }} | |
outputs: | |
has-new-content: ${{ steps.fetch.outputs.has-new-content }} | |
deploy: | |
needs: add-packages | |
if: ${{ needs.add-packages.outputs.has-new-content == 'true' }} | |
uses: ./.github/workflows/deploy.yaml |