mirror of
https://github.com/sboulema/mtg-deck.git
synced 2026-07-22 06:50:39 +00:00
83 lines
No EOL
1.8 KiB
YAML
83 lines
No EOL
1.8 KiB
YAML
name: MTG Deck
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- 'feature/**'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
version: '1.14.${{ github.run_number }}'
|
|
nodeVersion: '22'
|
|
|
|
jobs:
|
|
build:
|
|
name: 🛠️ Build
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
id-token: write
|
|
contents: read
|
|
attestations: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: ${{ env.nodeVersion }}.x
|
|
|
|
- name: Build plugin
|
|
run: |
|
|
npm install
|
|
npm run build
|
|
|
|
- name: Generate artifact attestation
|
|
uses: actions/attest@v4
|
|
with:
|
|
subject-path: |
|
|
main.js
|
|
styles.css
|
|
|
|
- name: Publish Build Artifacts
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: mtg-deck
|
|
path: |
|
|
main.js
|
|
manifest.json
|
|
styles.css
|
|
|
|
release:
|
|
if: github.ref_name == 'main'
|
|
name: 🚚 Release
|
|
needs: [build]
|
|
runs-on: ubuntu-latest
|
|
environment: Release
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: mtg-deck
|
|
|
|
- name: Tag release
|
|
id: tag_release
|
|
uses: mathieudutour/github-tag-action@v6.2
|
|
with:
|
|
tag_prefix: ''
|
|
custom_tag: '${{ env.version }}'
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Create a GitHub release
|
|
uses: ncipollo/release-action@v1.21.0
|
|
with:
|
|
tag: ${{ steps.tag_release.outputs.new_tag }}
|
|
name: ${{ steps.tag_release.outputs.new_tag }}
|
|
body: ${{ steps.tag_release.outputs.changelog }}
|
|
artifacts: 'main.js,manifest.json,styles.css'
|
|
skipIfReleaseExists: true |