Skip to content

Web Store TEST

Web Store TEST #1357

name: Web Store TEST
on:
# scheduleはdefault-latestでしか動かない
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#scheduled-events
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
jobs:
delivery:
runs-on: ubuntu-latest
env:
# v3開発版のAPP_ID
CHROMEWEBSTORE_APP_ID: egkgleinehaapbpijnlpbllfeejjpceb
NODE_ENV: staging
FIREBASE_CONFIG_JSONSTR: ${{ secrets.FIREBASE_CONFIG_JSONSTR }}
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
GITHUB_REPOSITORY: ${{ github.repository }}
steps:
- uses: actions/checkout@v3
with:
ref: develop
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 14.x
- name: Install dependencies
run: npm install
- name: Git User Info
run: |
git config --global user.email [email protected]
git config --global user.name "Ayanel CI"
- name: リリース必要性の判断
run: npm run should-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: npm run build
if: ${{ env.SHOULD_RELEASE_STAGE }}
- name: Pack ZIP
run: npm run pack
if: ${{ env.SHOULD_RELEASE_STAGE }}
- name: Publish to Chrome Web Store
run: npm run webstore-publish
if: ${{ env.SHOULD_RELEASE_STAGE }}
env:
GOOGLEAPI_CLIENT_ID: ${{ secrets.GOOGLEAPI_CLIENT_ID }}
GOOGLEAPI_CLIENT_SECRET: ${{ secrets.GOOGLEAPI_CLIENT_SECRET }}
GOOGLEAPI_REFRESH_TOKEN: ${{ secrets.GOOGLEAPI_REFRESH_TOKEN }}
# SHOULD_RELEASE_STAGE に関わらず、announcement.txtの内容をツイートする
- name: Tweet announcement
run: |
if [ -f announcement.txt ]; then
announcement=`cat announcement.txt`
npm run tweet "${announcement}"
fi
env:
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
- name: Create RELEASE PR
run: npm run create-release-pr
if: ${{ env.SHOULD_RELEASE_STAGE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}