Skip to content

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #333

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #333

Workflow file for this run

name: "make-modpack"
on:
push:
branches:
- "mainline"
tags:
- "[0-9]+.[0-9]+.[0-9]+"
pull_request:
branches:
- "mainline"
jobs:
build:
runs-on: "ubuntu-latest"
outputs:
version: ${{steps.version_meta.outputs.version}}
container_version: ${{steps.version_meta.outputs.container_version}}
env:
CONTAINER_TOKEN: "${{secrets.CONTAINER_TOKEN}}"
steps:
- id: "checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 1
- name: "generate config"
id: "configgen"
run: 'echo "twitch_token: ${{ secrets.CURSE_TOKEN }}" > config.yml'
- name: "fetch tags"
if: startsWith(github.ref, 'refs/tags')
run: |
git fetch --unshallow --tags
- name: "build client thing"
id: "client_build"
run: "make github_client"
- name: "build server thing"
id: "server_build"
run: "make github_server"
- name: "set version for artifact upload"
id: "version_meta"
run: |
echo "version=$(cat $(pwd)/.version)" >> "$GITHUB_ENV"
echo "container_version=$(cat $(pwd)/.version-container)" >> "$GITHUB_ENV"
echo ::set-output name=version::$(cat $(pwd)/.version)
echo ::set-output name=container_version::$(cat $(pwd)/.version-container)
- name: "upload artifact modpack i guess"
id: "client_upload"
uses: "actions/upload-artifact@v2"
with:
name: "ttmb-client-${{env.version}}"
path: "artifacts/github/client"
- name: "upload server modpack i guess"
id: "server_upload"
uses: "actions/upload-artifact@v2"
with:
name: "ttmb-server-${{env.version}}"
path: "artifacts/github/server"
- name: "upload container on tagged builds"
if: startsWith(github.ref, 'refs/tags')
run: |
docker login ghcr.io --username otakup0pe --password-stdin <<< "$CONTAINER_TOKEN"
docker push ghcr.io/tribesthatmaybe/workflow:${{env.container_version}}
- name: "notify discord on build failure"
if: failure()
uses: "rjstone/discord-webhook-notify@v1"
with:
severity: "error"
details: "Unable to complete ttmb build"
webhookUrl: ${{ secrets.DISCORD_BUILD_WEBHOOK }}
maybe_bump:
if: github.ref == 'refs/heads/mainline'
runs-on: "ubuntu-latest"
needs: "build"
steps:
- uses: "actions/checkout@v2"
with:
fetch-depth: 0
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
python-version: "3.7"
- name: "install avakas"
run: |
pip install avakas
- name: "Maybe bump version"
run: |
git config user.email [email protected]
git config user.name "An Automaton"
git remote set-url origin "$(git config --get remote.origin.url | sed 's#http.*com/#[email protected]:#g')"
eval `ssh-agent -t 300 -s`
ssh-add - <<< "${{secrets.DEPLOY_KEY}}"
mkdir -p ~/.ssh/
ssh-keyscan github.com >> ~/.ssh/known_hosts
./scripts/bump.sh
ssh-agent -k
deploy:
if: startsWith(github.ref, 'refs/tags')
needs: "build"
runs-on: ubuntu-latest
env:
STICKYPISTON_USER: "${{secrets.STICKYPISTON_USER}}"
STICKYPISTON_SERVER: "${{secrets.STICKYPISTON_SERVER}}"
STICKYPISTON_HOST: "${{secrets.STICKYPISTON_HOST}}"
FTP_PASSWORD: "${{secrets.FTP_PASSWORD}}"
MULTICRAFT_API_KEY: "${{secrets.MULTICRAFT_API_KEY}}"
MULTICRAFT_API_HOST: "${{secrets.MULTICRAFT_API_HOST}}"
RCON_PORT: "${{secrets.RCON_PORT}}"
RCON_PASSWORD: "${{secrets.RCON_PASSWORD}}"
CURSEFORGE_TOKEN: "${{secrets.CURSEFORGE_TOKEN}}"
GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"
CONTAINER_TOKEN: "${{secrets.CONTAINER_TOKEN}}"
steps:
- uses: "actions/checkout@v2"
with:
ref: "mainline"
fetch-depth: 1
- name: "fetch server artifact"
uses: "actions/[email protected]"
with:
name: "ttmb-server-${{needs.build.outputs.version}}"
path: "server-artifact"
- name: "recompress server artifact because reasons"
run: |
mkdir -p artifacts
cd server-artifact
zip -r ../artifacts/ttmb-server-${{needs.build.outputs.version}}.zip *
- name: "pull workflow container"
run: |
docker login ghcr.io --username otakup0pe --password-stdin <<< "$CONTAINER_TOKEN"
docker pull ghcr.io/tribesthatmaybe/workflow:${{needs.build.outputs.container_version}}
- name: "deploy to dev server"
run: |
./scripts/render-devsync.sh
./scripts/deploy ${{needs.build.outputs.container_version}} ${{needs.build.outputs.version}}
upload:
if: startsWith(github.ref, 'refs/tags')
runs-on: "ubuntu-latest"
needs: "build"
env:
STICKYPISTON_USER: "${{secrets.STICKYPISTON_USER}}"
STICKYPISTON_SERVER: "${{secrets.STICKYPISTON_SERVER}}"
STICKYPISTON_HOST: "${{secrets.STICKYPISTON_HOST}}"
FTP_PASSWORD: "${{secrets.FTP_PASSWORD}}"
MULTICRAFT_API_KEY: "${{secrets.MULTICRAFT_API_KEY}}"
MULTICRAFT_API_HOST: "${{secrets.MULTICRAFT_API_HOST}}"
RCON_PORT: "${{secrets.RCON_PORT}}"
RCON_PASSWORD: "${{secrets.RCON_PASSWORD}}"
CURSEFORGE_TOKEN: "${{secrets.CURSEFORGE_TOKEN}}"
GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"
CONTAINER_TOKEN: "${{secrets.CONTAINER_TOKEN}}"
steps:
- uses: "actions/checkout@v2"
with:
ref: "mainline"
fetch-depth: 1
- name: "fetch server artifact"
uses: "actions/[email protected]"
with:
name: "ttmb-server-${{needs.build.outputs.version}}"
path: "server-artifact"
- name: "fetch client artifact"
uses: "actions/[email protected]"
with:
name: "ttmb-client-${{needs.build.outputs.version}}"
path: "client-artifact"
- name: "recompress server artifact because reasons"
run: |
mkdir -p artifacts
cd server-artifact
zip -r ../artifacts/ttmb-server-${{needs.build.outputs.version}}.zip *
- name: "recompress client artifact because reasons"
run: |
mkdir -p artifacts
cd client-artifact
zip -r ../artifacts/ttmb-client-${{needs.build.outputs.version}}.zip *
- name: "pull workflow container"
run: |
docker login ghcr.io --username otakup0pe --password-stdin <<< "$CONTAINER_TOKEN"
docker pull ghcr.io/tribesthatmaybe/workflow:${{needs.build.outputs.container_version}}
- name: "upload to curseforge"
run: |
./scripts/render-devsync.sh
./scripts/upload ${{needs.build.outputs.container_version}} ${{needs.build.outputs.version}}
- name: "notify discord on upload failure"
if: failure()
uses: "rjstone/discord-webhook-notify@v1"
with:
severity: "error"
details: "Unable to complete ttmb build"
webhookUrl: ${{ secrets.DISCORD_BUILD_WEBHOOK }}
- name: "notify discord on upload success"
if: success()
uses: "rjstone/discord-webhook-notify@v1"
with:
severity: "info"
details: "New build ${{needs.build.outputs.version}} uploaded to curse"
webhookUrl: ${{ secrets.DISCORD_BUILD_WEBHOOK }}