diff --git a/.github/workflows/auto-changelog.yml b/.github/workflows/auto-changelog.yml new file mode 100644 index 0000000..2f830ed --- /dev/null +++ b/.github/workflows/auto-changelog.yml @@ -0,0 +1,55 @@ +name: ChangeLog + +on: + workflow_dispatch: + release: + types: [published] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/setup-node@v2-beta + with: + node-version: '12' + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Checkout Tool + uses: actions/checkout@v2 + with: + repository: konakonall/auto-changelog + path: 'auto-changelog' + - name: Build Tool + run: | + cd auto-changelog + npm install + npm link + + - name: Generate ChangeLog + env: # Or as an environment variable + TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + auto-changelog --token $TOKEN + - name: Cat ChangeLog + run: cat CHANGELOG.md + + - name: Commit files + env: + CI_USER: "gouki0123" + CI_EMAIL: "gouki0123@gmail.com" + run: | + git config --local user.email "$CI_EMAIL" + git config --local user.name "$CI_USER" + git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && echo "push=1" >> $GITHUB_ENV || echo "No changes to CHANGELOG.md" + + - name: Push changes + if: env.push == 1 + env: + CI_USER: "gouki0123" + CI_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git push "https://$CI_USER:$CI_TOKEN@github.com/$GITHUB_REPOSITORY.git" HEAD:master diff --git a/.github/workflows/qunit.yml b/.github/workflows/qunit.yml deleted file mode 100644 index a3da52e..0000000 --- a/.github/workflows/qunit.yml +++ /dev/null @@ -1,67 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: QUnit - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - - name: Cache Node modules - id: npm-cache - uses: actions/cache@v2 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - # Runs a single command using the runners shell - - name: Install dependencies - run: | - npm install pm2 - npm install - - # Runs a single command using the runners shell - - name: Prepare Task - env: - SECRET_ID: ${{ secrets.SECRET_ID }} - SECRET_KEY: ${{ secrets.SECRET_KEY }} - REGION: ${{ secrets.REGION }} - BUCKET: ${{ secrets.BUCKET }} - UIN: ${{ secrets.UIN }} - run: | - sed -i -e "s/10001/$UIN/" test/test.js - sed -i -e "s/allowPrefix: '_ALLOW_DIR_\/\*'/allowPrefix: '\*'/" server/sts.js - sed -i -e "s/process.env.SecretId/\"$SECRET_ID\"/" server/sts.js - sed -i -e "s/process.env.SecretKey/\"$SECRET_KEY\"/" server/sts.js - sed -i -e "s/process.env.Bucket/\"$BUCKET\"/" server/sts.js - sed -i -e "s/process.env.Region/\"$REGION\"/" server/sts.js - sed -i -e "s/PutObject/\*/" server/sts.js - - # Runs a set of commands using the runners shell - - name: Start Server - run: ./node_modules/pm2/bin/pm2 start server/sts.js - - - name: Test - run: | - curl http://127.0.0.1:3000/sts - node test/watcher.js - - - name: End Server - run: ./node_modules/pm2/bin/pm2 stop server/sts.js