Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
chore: refactor actions structure
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmitr committed Jun 16, 2024
1 parent 7d82a66 commit 65be80d
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/package-raspberry-pi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build package for Raspberry Pi

on:
push:
release:
types: [published]

workflow_call:

jobs:
build:
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish release

on:
workflow_call:
secrets:
repo-token:
required: true

jobs:
release_draft:
needs: build
# if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download Raspberry Pi archive
uses: actions/download-artifact@v4
with:
name: nostr-wallet-connect.zip
path: artifacts

- name: Download Linux desktop archive
uses: actions/download-artifact@v4
with:
name: albyhub-Linux
path: artifacts

- name: Download macOS desktop archive
uses: actions/download-artifact@v4
with:
name: albyhub-macOS
path: artifacts

- name: Download Windows desktop archive
uses: actions/download-artifact@v4
with:
name: albyhub-Windows
path: artifacts

- name: Create release draft
env:
GH_TOKEN: ${{ secrets.repo-token }}
# tag: ${{ github.ref_name }}
tag: ${{ github.sha }} # FIXME: for testing only.
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes \
--draft \
./artifacts/*
28 changes: 28 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
# TODO: use release event instead of push
push:

workflow_dispatch:

jobs:
build-raspberry-pi:
uses: ./.github/workflows/package-raspberry-pi.yaml

build-wails:
uses: ./.github/workflows/wails2.yaml
secrets:
APPLE_DEVELOPER_CERTIFICATE_P12_BASE64: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}
APPLE_DEVELOPER_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_USERNAME: ${{ secrets.APPLE_USERNAME }}

release-draft:
needs:
- build-raspberry-pi
- build-wails
uses: ./.github/workflows/publish-release.yaml
secrets:
repo-token: ${{ secrets.GITHUB_TOKEN }}
37 changes: 13 additions & 24 deletions .github/workflows/wails2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ name: Wails build - all platforms
on:
push:

workflow_call:
secrets:
APPLE_DEVELOPER_CERTIFICATE_P12_BASE64:
required: true
APPLE_DEVELOPER_CERTIFICATE_PASSWORD:
required: true
APPLE_PASSWORD:
required: true
APPLE_TEAM_ID:
required: true
APPLE_USERNAME:
required: true

jobs:
build:
strategy:
Expand Down Expand Up @@ -227,27 +240,3 @@ jobs:
path: |
./build/bin/albyhub-${{runner.os}}.zip
if-no-files-found: error

release_draft:
needs: build
# if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true

- name: Create release draft
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# tag: ${{ github.ref_name }}
tag: ${{ github.sha }} # FIXME: for testing only.
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes \
--draft \
./artifacts/*

0 comments on commit 65be80d

Please sign in to comment.