Skip to content

Commit

Permalink
Merge pull request #46 from holochain-apps/fix/release-workflow
Browse files Browse the repository at this point in the history
Fix release workflow
  • Loading branch information
tibetsprague authored Jun 14, 2024
2 parents 1344fb1 + 7f4a117 commit 82c8d5a
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 13 deletions.
71 changes: 66 additions & 5 deletions .github/workflows/release-tauri-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,57 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+-dev.[0-9]+'

jobs:
publish-happ:
permissions:
contents: write
runs-on: ubuntu-22.04
outputs:
releaseId: ${{ steps.create-release.outputs.id }}
appVersion: ${{ steps.version.outputs.APP_VERSION }}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# Checks out a copy of your repository on the ubuntu-latest machine
- uses: actions/checkout@v3

- name: Extend space
uses: ./.github/actions/extend-space

- name: Install nix
uses: cachix/install-nix-action@v18
with:
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
extra_nix_config: |
experimental-features = flakes nix-command
- uses: cachix/cachix-action@v12
with:
name: holochain-ci

- uses: cachix/cachix-action@v12
with:
name: darksoil-studio

- name: Install and test
run: |
nix-store --gc
nix develop --command bash -c "npm i && npm run build:happ"
- name: Retrieve version
run: |
echo "APP_VERSION=$(cat src-tauri/tauri.conf.json | grep -oP '(?<="version": ")[^"]*')" >> $GITHUB_OUTPUT
id: version

- id: create-release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "workdir/relay.happ"
body: "See assets below to download and install this version."
name: Relay v${{ steps.version.outputs.APP_VERSION }}
tag: Relay-v${{ steps.version.outputs.APP_VERSION }}
prerelease: true
draft: true

release-tauri-app:
strategy:
fail-fast: false
Expand Down Expand Up @@ -33,6 +84,7 @@ jobs:
with:
override: true
toolchain: stable

- name: install Go stable
uses: actions/setup-go@v4
with:
Expand All @@ -59,14 +111,23 @@ jobs:
run: |
npm install
- name: Download release of the .happ
id: release_data
uses: KevinRohn/github-full-release-data@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repository: "holochain-apps/volla-chat"
token: ${{ secrets.GITHUB_TOKEN }}
version: Relay-v${{ needs.publish-happ.outputs.appVersion }}
asset-file: '*.happ'
asset-output: 'workdir/'

- name: build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: $
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: src-tauri
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: "Relay v__VERSION__"
releaseBody: "See assets below to download and install this version."
releaseId: ${{ needs.publish-happ.outputs.releaseId }}
releaseDraft: true
prerelease: true
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.1-dev.2",
"identifier": "org.holochain.relay",
"build": {
"beforeBuildCommand": "npm run build -w ui && npm run build:happ",
"beforeBuildCommand": "npm run build -w ui",
"devUrl": "http://localhost:1420",
"frontendDist": "../ui/build"
},
Expand Down
14 changes: 7 additions & 7 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write .",
"package": "rm -f dist.zip && npm run build && cd dist && bestzip ../dist.zip *"
"package": "rm -f dist.zip && npm run build && cd build && bestzip ../dist.zip *"
},
"devDependencies": {
"@holochain/client": "=0.17.0-rc.0",
"@holochain-open-dev/profiles": "^0.400.0-dev.1",
"@holochain-open-dev/utils": "^0.300.0-rc.0",
"@holochain-open-dev/elements": "^0.300.0-rc.0",
"@skeletonlabs/skeleton": "^2.8.0",
"@holochain/client": "=0.17.0-rc.0",
"@holochain-open-dev/profiles": "^0.400.0-dev.1",
"@holochain-open-dev/utils": "^0.300.0-rc.0",
"@holochain-open-dev/elements": "^0.300.0-rc.0",
"@skeletonlabs/skeleton": "^2.8.0",
"@skeletonlabs/tw-plugin": "^0.3.1",
"@sveltejs/adapter-static": "^3.0.0",
"@sveltejs/kit": "^2.5.10",
Expand Down Expand Up @@ -50,4 +50,4 @@
"dependencies": {
"@tauri-apps/api": "2.0.0-beta.13"
}
}
}

0 comments on commit 82c8d5a

Please sign in to comment.