v1.0.22 #43
Workflow file for this run
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 Deploy Release | |
on: | |
push: | |
tags: | |
- v1.* | |
workflow_dispatch: | |
permissions: | |
contents: read | |
concurrency: | |
group: "deploy" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: | | |
pnpm run build | |
- name: Upload pages artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
name: daxfb-calculator-pages | |
path: dist | |
- name: Zip release artifact | |
run: | | |
zip -r daxfb-calculator.zip * | |
working-directory: dist | |
- name: Upload release artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: daxfb-calculator-release | |
path: dist/daxfb-calculator.zip | |
retention-days: 1 | |
deploy-pages: | |
needs: build | |
permissions: | |
id-token: write | |
pages: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy GitHub pages | |
id: deployment | |
uses: actions/deploy-pages@v1 | |
with: | |
artifact_name: daxfb-calculator-pages | |
deploy-release: | |
if: github.event_name == 'push' | |
needs: build | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get tag name | |
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Download release artifact | |
id: download_artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: daxfb-calculator-release | |
- name: Check artifact | |
run: | | |
ls -lR ${{ steps.download_artifact.outputs.download-path }} | |
cp ${{ steps.download_artifact.outputs.download-path }}/daxfb-calculator.zip daxfb-calculator-${{ env.RELEASE_TAG }}.zip | |
ls -l . | |
unzip -t daxfb-calculator-${{ env.RELEASE_TAG }}.zip | |
- name: Build changelog | |
id: changelog | |
uses: metcalfc/[email protected] | |
with: | |
myToken: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check changelog | |
run: | | |
printf %s "${{ steps.changelog.outputs.changelog }}" > CHANGELOG.txt | |
ls -l . | |
- name: Create release | |
uses: softprops/[email protected] | |
with: | |
draft: true | |
prerelease: false | |
generate_release_notes: false | |
body_path: CHANGELOG.txt | |
files: | | |
daxfb-calculator-${{ env.RELEASE_TAG }}.zip |