build: update deps #2127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
pull_request: | |
push: | |
branches-ignore: | |
- gh-pages | |
jobs: | |
tool: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install | |
uses: wyvox/action-setup-pnpm@v3 | |
- name: Set env | |
run: node ./scripts/info.js | |
- name: Build | |
run: pnpm build:tool | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: tool | |
path: ./dist/tool | |
- name: Test | |
run: pnpm test:tool | |
- name: Prepare release | |
if: github.ref == 'refs/heads/master' | |
# zip is not working with symbolic link | |
run: | | |
cd ./dist/tool | |
pnpm install --prod --no-lockfile --node-linker=hoisted | |
zip -r ../../release.zip . | |
- name: Publish release | |
uses: ncipollo/release-action@v1 | |
if: github.ref == 'refs/heads/master' | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: ${{ github.event.head_commit.message }} | |
tag: v${{ env.PACKAGE_VERSION }} | |
commit: ${{ github.sha }} | |
artifacts: ./release.zip | |
allowUpdates: true | |
server: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- name: Install | |
uses: wyvox/action-setup-pnpm@v3 | |
- name: Set env | |
run: node ./scripts/info.js | |
- name: Build | |
run: pnpm build:server | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: server | |
path: ./dist | |
- name: Test | |
env: | |
APP_ID: ${{ secrets.APP_ID }} | |
APP_KEY: ${{ secrets.APP_KEY }} | |
APP_INSTALLATION_ID: ${{ secrets.APP_INSTALLATION_ID }} | |
APP_CLIENT_ID: ${{ secrets.APP_CLIENT_ID }} | |
APP_CLIENT_SECRET: ${{ secrets.APP_CLIENT_SECRET }} | |
DB_PATH: db | |
DB_REPO: EhTagTranslation/Database | |
run: pnpm test:server | |
- name: Deploy | |
if: github.ref == 'refs/heads/master' | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
run: flyctl deploy --remote-only | |
browser: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install | |
uses: wyvox/action-setup-pnpm@v3 | |
- name: Set env | |
run: node ./scripts/info.js | |
- name: Build | |
run: pnpm build:browser | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: browser | |
path: ./dist/browser | |
- name: Test | |
run: pnpm test:browser |