chore: add GitHub action to make a release with `.xdc` file

This commit is contained in:
WofWca 2023-03-26 16:11:56 +04:00
parent bcd1528faa
commit 0e72842668
1 changed files with 45 additions and 16 deletions

View File

@ -3,16 +3,18 @@
name: Deploy Nuxt site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["webxdc-prototype"]
tags:
- webxdc*
# branches: ["webxdc-prototype"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
# Need `contents: write` to make a release.
contents: write
pages: write
id-token: write
@ -23,8 +25,43 @@ concurrency:
cancel-in-progress: false
jobs:
# Build job
build:
release-webxdc:
# Only make a release on tags
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
# TODO refactor: steps are duplicated for both jobs. I think
# YAML can help here.
- name: Checkout
uses: actions/checkout@v3
# https://pnpm.io/continuous-integration
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build-webxdc
- name: Release
uses: softprops/action-gh-release@v1
with:
# prerelease: ${{ contains(github.event.ref, '-beta') }}
prerelease: true
fail_on_unmatched_files: true
files: dist/*.xdc
# Deploy to GitHub Pages.
deploy-gh-pages:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
@ -39,10 +76,11 @@ jobs:
with:
node-version: "16"
cache: "pnpm"
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Install dependencies
run: pnpm install
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build
env:
REPO_OWNER_AND_NAME: ${{ github.repository }}
@ -53,15 +91,6 @@ jobs:
uses: actions/upload-pages-artifact@v1
with:
path: ./dist
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1