Build and Release Trophies Plugin #1
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 and Release Trophies Plugin | |
on: | |
push: | |
tags: | |
- 'v*' | |
pull_request: | |
branches: ['main'] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '18.3' | |
- name: Install Dependencies | |
run: npm install | |
- name: build | |
run: npm run build | |
- name: copy files into build | |
run: | | |
cp plugin.json ./dist/ | |
mkdir ./dist/dist | |
mv ./dist/index.js ./dist/dist/ | |
- name: Upload package | |
uses: actions/upload-artifact@v2 | |
with: | |
name: decky-trophies | |
path: | | |
./dist/* | |
release: | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: decky-trophies | |
path: decky-trophies | |
- name: zip/tar release | |
run: | | |
zip -r decky-trophies.zip decky-trophies/* | |
tar -czvf decky-trophies.tar.gz decky-trophies | |
- name: Create a release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: 'decky-trophies.zip,decky-trophies.tar.gz' | |
allowUpdates: true |