Skip to content

Release (Production version for A2 + Binaries + GH Pages) #1

Release (Production version for A2 + Binaries + GH Pages)

Release (Production version for A2 + Binaries + GH Pages) #1

Workflow file for this run

name: Release (Production version for A2 + Binaries + GH Pages)
on: [workflow_dispatch]
jobs:
validate-tag:
name: Validate tag
runs-on: ubuntu-latest
steps:
- name: Check Tag to Build on
run: |
TAG="${{ github.ref_name }}"
if [[ ! "$TAG" =~ ^v ]]; then
echo "The workflow was run from an invalid ref."
echo "Expected the ref name to start with a \"v\"."
echo "If using the GitHub UI, please select a tag from the \"Use workflow from\" dropdown."
exit 1
fi
run-tests:
name: Run Tests
needs: validate-tag
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Set up Node
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version: 20.15.0
cache: "npm"
- name: Install Node dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps
- name: Test
run: npm run test
build-pages:
name: Build GitHub Page
needs: run-tests
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Check out
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Set up Node
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version: 20.15.0
cache: "npm"
- name: Install Node dependencies
run: npm ci
- name: Build
run: npm run build -- --base=/abicus/
- name: Upload Pages artefact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa
with:
path: dist/
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
tag-docker:
needs: run-tests
name: Pull Dev Image from A2 ECR and Tag It as Prod
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
with:
role-to-assume: arn:aws:iam::${{ secrets.UTILITY_ACCOUNT_ID }}:role/AbicusGithubActionsAccessRole
aws-region: eu-north-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076
- name: Pull Dev Image
run: docker pull ${{ steps.login-ecr.outputs.registry }}/abicus:${{ github.ref_name }}
- name: Tag Dev Image as Prod Image
run: docker tag ${{ steps.login-ecr.outputs.registry }}/abicus:${{ github.ref_name }} ${{ steps.login-ecr.outputs.registry }}/abicus-prod:${{ github.ref_name }}
- name: Push Prod Image
run: docker push ${{ steps.login-ecr.outputs.registry }}/abicus-prod:${{ github.ref_name }}
build-binaries:
needs: run-tests
strategy:
fail-fast: false
matrix:
include:
- title: MacOS (arm64)
platform: macos-latest
args: "--target aarch64-apple-darwin"
- title: MacOS (x86_64)
platform: macos-latest
args: "--target x86_64-apple-darwin"
- title: Ubuntu
platform: ubuntu-20.04
args: ""
- title: Windows
platform: windows-latest
args: ""
name: Build Desktop Application (${{ matrix.title }})
runs-on: ${{ matrix.platform }}
steps:
- name: Check out
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Set up Node
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version: 20.15.0
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@1fbea72663f6d4c03efaab13560c8a24cfd2a7cc
with:
target: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Install build dependencies (Ubuntu)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install Node dependencies
run: npm ci
- uses: tauri-apps/tauri-action@41242bd545b6d1310ffc1685fb8bb87e97f0b748
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
with:
args: ${{ matrix.args }}
releaseDraft: true
tagName: ${{ github.ref_name }}
releaseName: Abicus v__VERSION__
releaseBody: |
<img alt="logo" height="100" src="https://github.com/digabi/abicus/blob/master/app-icon.png" />
### Precompiled binaries
<table>
<tr>
<td>Linux</td>
<td>Windows</td>
<td>MacOS</td>
</tr>
<tr>
<td>
<ul>
<li>
<a href="https://github.com/digabi/abicus/releases/download/v__VERSION__/abicus___VERSION___amd64.AppImage">
AppImage (x64)
</a>
</li>
<li>
<a href="https://github.com/digabi/abicus/releases/download/v__VERSION__/abicus___VERSION___amd64.deb">
Debian (x64 <code>.deb</code>)
</a>
</li>
</ul>
</td>
<td>
<ul>
<li>
<a href="https://github.com/digabi/abicus/releases/download/v__VERSION__/Abicus___VERSION___x64-setup.exe">
Windows Installer (x64 <code>.exe</code>)
</a>
</li>
</ul>
</td>
<td>
<ul>
<li>
<a href="https://github.com/digabi/abicus/releases/download/v__VERSION__/Abicus_aarch64.app.tar.gz">
Mac-computers with Apple-processors (<code>.app</code>)
</a>
</li>
<li>
<a href="https://github.com/digabi/abicus/releases/download/v__VERSION__/Abicus_x64.app.tar.gz">
Mac-computers with Intel-processors (<code>.app</code>)
</a>
</li>
<li>
<a href="https://github.com/digabi/abicus/releases/download/v__VERSION__/Abicus___VERSION___aarch64.dmg">
Mac-computers with Apple-processors (<code>.dmg</code>)
</a>
</li>
<li>
<a href="https://github.com/digabi/abicus/releases/download/v__VERSION__/Abicus___VERSION___x64.dmg">
Mac-computers with Intel-processors (<code>.dmg</code>)
</a>
</li>
</ul>
</td>
</tr>
</table>