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

feat: automatically publish releases #407

Merged
merged 19 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Create release

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

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Download Raspberry Pi archive
uses: actions/download-artifact@v4
with:
name: nostr-wallet-connect.tar.bz2
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 without tag
if: github.ref_type != 'tag'
env:
GH_TOKEN: ${{ secrets.repo-token }}
tag: ${{ github.sha }}
run: |
gh release create \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes \
--draft \
./artifacts/*

- name: Create release with tag
if: github.ref_type == 'tag'
env:
GH_TOKEN: ${{ secrets.repo-token }}
tag: ${{ github.ref_name }}
run: |
gh release create \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes \
--draft \
--verify-tag \
./artifacts/*
25 changes: 23 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 Expand Up @@ -55,10 +55,31 @@ jobs:
${{ github.workspace }}/armv6-unknown-linux-gnueabihf/bin/armv6-unknown-linux-gnueabihf-strip ./nostr-wallet-connect
patchelf --force-rpath --set-rpath '$ORIGIN/lib' ./nostr-wallet-connect

# TODO: remove this once install.sh and update.sh are updated (they currently use this artifact)
# it produces a ZIP archive that loses all permissions
- name: Archive the artifacts
uses: actions/upload-artifact@v4
with:
name: nostr-wallet-connect.zip
path: |
lib/
nostr-wallet-connect

- name: Add Linux perms
run: chmod +x ./nostr-wallet-connect

# Store everything in a tar archive to preserve permissions
# (specifically, the executable bit on the app executable).
- name: Make output tar archive
run: |
mkdir -p ./tmp
mv ./nostr-wallet-connect ./tmp/
mv ./lib ./tmp/
tar -cjf nostr-wallet-connect-rpi.tar.bz2 -C ./tmp .
rm -Rf ./tmp

- name: Upload the package
uses: actions/upload-artifact@v4
with:
name: nostr-wallet-connect-rpi.tar.bz2
path: nostr-wallet-connect-rpi.tar.bz2
27 changes: 27 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release

on:
push:

workflow_dispatch:

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

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/create-release.yaml
secrets:
repo-token: ${{ secrets.GITHUB_TOKEN }}
64 changes: 0 additions & 64 deletions .github/workflows/wails.yaml

This file was deleted.

28 changes: 25 additions & 3 deletions .github/workflows/wails.yml
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 All @@ -16,7 +29,7 @@ jobs:
]
runs-on: ${{ matrix.build.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive

Expand Down Expand Up @@ -46,7 +59,7 @@ jobs:
run: go get -v -t -d ./...

- name: Setup NodeJS
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "20.x"

Expand Down Expand Up @@ -195,6 +208,15 @@ jobs:
AC_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
AC_PROVIDER: ${{ secrets.APPLE_TEAM_ID }}

- name: Make Windows ZIP archive
if: runner.os == 'Windows'
run: |
mkdir -p ./build/out
7z a -tzip ./build/out/albyhub-${{runner.os}}.zip ./build/bin/*
rm -Rf ./build/bin/*
mv ./build/out/albyhub-${{runner.os}}.zip ./build/bin/
shell: bash

- uses: actions/upload-artifact@v4
if: runner.os == 'Linux'
with:
Expand All @@ -216,5 +238,5 @@ jobs:
with:
name: albyhub-${{runner.os}}
path: |
*\bin\*
./build/bin/albyhub-${{runner.os}}.zip
if-no-files-found: error
Loading