Skip to content

Commit 9be6da4

Browse files
workflow: RIP TWLBot
- Remove uploading to TWLBot - Remove Discord webhook temporarily until a non-TWLBot solution is found
1 parent 61f0c1a commit 9be6da4

File tree

1 file changed

+0
-86
lines changed

1 file changed

+0
-86
lines changed

.github/workflows/build.yml

-86
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ jobs:
1818
runs-on: ubuntu-latest
1919
container: devkitpro/devkitarm
2020
name: Build with Docker using devkitARM
21-
outputs:
22-
commit_tag: ${{ steps.build.outputs.commit_tag }}
23-
commit_hash: ${{ steps.build.outputs.commit_hash }}
24-
author_name: ${{ steps.build.outputs.author_name }}
25-
committer_name: ${{ steps.build.outputs.committer_name }}
26-
commit_subject: ${{ steps.build.outputs.commit_subject }}
27-
commit_message: ${{ steps.build.outputs.commit_message }}
2821
steps:
2922
- name: Checkout repo
3023
uses: actions/checkout@v3
@@ -38,15 +31,6 @@ jobs:
3831
id: build
3932
run: |
4033
make
41-
42-
echo ::set-output name=commit_tag::$(git describe --abbrev=0 --tags)
43-
echo ::set-output name=commit_hash::$(git log --format=%h -1)
44-
45-
# Webhook info
46-
echo "::set-output name=author_name::$(git log -1 $GITHUB_SHA --pretty=%aN)"
47-
echo "::set-output name=committer_name::$(git log -1 $GITHUB_SHA --pretty=%cN)"
48-
echo "::set-output name=commit_subject::$(git log -1 $GITHUB_SHA --pretty=%s)"
49-
echo "::set-output name=commit_message::$(git log -1 $GITHUB_SHA --pretty=%b)"
5034
- name: Pack 7z for nightly
5135
if: ${{ !startsWith(github.ref, 'refs/tags') }}
5236
run: |
@@ -72,14 +56,6 @@ jobs:
7256
name: Publish build to TWLBot/Builds
7357
if: ${{ success() && !startsWith(github.ref, 'refs/pull') }}
7458
needs: build
75-
env:
76-
COMMIT_TAG: ${{ needs.build.outputs.commit_tag }}
77-
COMMIT_HASH: ${{ needs.build.outputs.commit_hash }}
78-
AUTHOR_NAME: ${{ needs.build.outputs.author_name }}
79-
COMMIT_SUBJECT: ${{ needs.build.outputs.commit_subject }}
80-
COMMIT_MESSAGE: ${{ needs.build.outputs.commit_message }}
81-
outputs:
82-
current_date: ${{ steps.commit.outputs.current_date }}
8359
steps:
8460
- name: Download artifacts
8561
uses: actions/download-artifact@v3
@@ -99,65 +75,3 @@ jobs:
9975
10076
curl -XPOST -H "$AUTH_HEADER" -H "$CONTENT_LENGTH" -H "$CONTENT_TYPE" --upload-file "$file" "$UPLOAD_URL"
10177
done
102-
- name: Commit and push to TWLBot/Builds
103-
if: ${{ !startsWith(github.ref, 'refs/tags') }}
104-
id: commit
105-
run: |
106-
CURRENT_DATE=$(date +"%Y%m%d-%H%M%S")
107-
echo ::set-output name=current_date::$CURRENT_DATE
108-
109-
git config --global user.email "flamekat54@aol.com"
110-
git config --global user.name "TWLBot"
111-
git clone --depth 1 https://${{ secrets.TWLBOT_TOKEN }}@github.com/TWLBot/Builds.git
112-
mkdir -p Builds/extras
113-
cd Builds/extras
114-
cp ${{ github.workspace }}/build/* .
115-
git stage .
116-
git commit -m "hiyaCFW | $COMMIT_HASH"
117-
git tag v$CURRENT_DATE
118-
git push origin master v$CURRENT_DATE
119-
- name: Release to TWLBot/Builds
120-
if: ${{ !startsWith(github.ref, 'refs/tags') }}
121-
run: |
122-
AUTH_HEADER="Authorization: token ${{ secrets.TWLBOT_TOKEN }}"
123-
CONTENT_TYPE="Content-Type: application/json"
124-
API_URL="https://api.github.com/repos/TWLBot/Builds/releases"
125-
RELEASE_INFO="{\"tag_name\": \"v${{ steps.commit.outputs.current_date }}\", \"name\": \"hiyaCFW | $COMMIT_HASH\", \"body\": \"$AUTHOR_NAME - $COMMIT_SUBJECT\\n\\n$COMMIT_MESSAGE\", \"prerelease\": true}"
126-
127-
RESPONSE=$(curl -XPOST -H "$AUTH_HEADER" -H "$CONTENT_TYPE" "$API_URL" -d "$RELEASE_INFO")
128-
129-
ID=$(echo $RESPONSE | jq --raw-output '.id')
130-
131-
for file in ${{ github.workspace }}/build/*; do
132-
AUTH_HEADER="Authorization: token ${{ secrets.TWLBOT_TOKEN }}"
133-
CONTENT_LENGTH="Content-Length: $(stat -c%s $file)"
134-
CONTENT_TYPE="Content-Type: application/7z-x-compressed"
135-
UPLOAD_URL="https://uploads.github.com/repos/TWLBot/Builds/releases/$ID/assets?name=$(basename $file)"
136-
137-
curl -XPOST -H "$AUTH_HEADER" -H "$CONTENT_LENGTH" -H "$CONTENT_TYPE" --upload-file "$file" "$UPLOAD_URL"
138-
done
139-
140-
send_webhook:
141-
runs-on: ubuntu-latest
142-
needs: [publish_build, build]
143-
name: Send Discord webhook
144-
if: ${{ !startsWith(github.ref, 'refs/pull') }}
145-
env:
146-
CURRENT_DATE: ${{ needs.publish_build.outputs.current_date }}
147-
AUTHOR_NAME: ${{ needs.build.outputs.author_name }}
148-
COMMITTER_NAME: ${{ needs.build.outputs.committer_name }}
149-
COMMIT_SUBJECT: ${{ needs.build.outputs.commit_subject }}
150-
COMMIT_MESSAGE: ${{ needs.build.outputs.commit_message }}
151-
steps:
152-
- name: Send success webhook
153-
if: ${{ success() }}
154-
run: |
155-
curl -o send.sh https://raw.githubusercontent.com/DS-Homebrew/discord-webhooks/master/send-ghactions.sh
156-
chmod +x send.sh
157-
./send.sh success ${{ secrets.WEBHOOK_URL }}
158-
- name: Send failure webhook
159-
if: ${{ failure() }}
160-
run: |
161-
curl -o send.sh https://raw.githubusercontent.com/DS-Homebrew/discord-webhooks/master/send-ghactions.sh
162-
chmod +x send.sh
163-
./send.sh failure ${{ secrets.WEBHOOK_URL }}

0 commit comments

Comments
 (0)