Add extra colours #278
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: Commit Tasks | |
on: | |
push: | |
paths: | |
- '**.java' | |
- 'pom.xml' | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '21' | |
- name: Run mvn test | |
run: mvn test | |
check-spelling: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Codespell | |
run: pip install codespell | |
- name: Check spelling | |
run: codespell -S=".git" | |
check-for-non-lettuce-imports: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Download script | |
run: curl https://gist.githubusercontent.com/CominAtYou/5538252475fbe317064daa5ff5d26489/raw/36a96d30fbc4d8129edac95d005c147d26259a43/CheckForImports.py -o 'importscript.py' | |
- name: Run script | |
run: python ./importscript.py | |
deploy: | |
if: ${{ !startsWith(github.event.head_commit.message, '[nodeploy]') && github.ref == 'refs/heads/master' && github.repository == 'CominAtYou/Hildabot' && github.event_name == 'push' }} | |
runs-on: ubuntu-latest | |
needs: [test, check-for-non-lettuce-imports, check-spelling] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'zulu' | |
java-version: '21' | |
- name: Prepare files | |
env: | |
CONFIG_DATA: ${{ secrets.CONFIG_DATA }} | |
run: "printf \"$CONFIG_DATA\" > $GITHUB_WORKSPACE/src/main/java/com/cominatyou/Config.java" | |
- name: Build jar | |
run: mvn clean compile assembly:single | |
- name: Sign jar | |
run: "echo '${{ secrets.SIGNATURE_KEY }}' | base64 -d > $GITHUB_WORKSPACE/signature.pem && openssl dgst -sha256 -sign $GITHUB_WORKSPACE/signature.pem -out $GITHUB_WORKSPACE/hildabot.jar.signature $GITHUB_WORKSPACE/target/hildabot-*.jar" | |
- name: "Prepare for deployment" | |
run: "mv $GITHUB_WORKSPACE/target/hildabot-*.jar $GITHUB_WORKSPACE/target/hildabot.jar" | |
- name: Deploy bot | |
env: | |
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | |
DEPLOY_URL: ${{ secrets.DEPLOY_URL }} | |
run: "curl -s -f -X POST -F payload=@$GITHUB_WORKSPACE/target/hildabot.jar -F signaturefile=@$GITHUB_WORKSPACE/hildabot.jar.signature -H \"Authorization: $DEPLOY_KEY\" -m 30 $DEPLOY_URL" |