2023-08-03 01:47:26 +02:00
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [created]
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
packages: write
|
|
|
|
|
2023-12-26 20:49:47 +01:00
|
|
|
env:
|
2024-04-28 16:39:57 +02:00
|
|
|
GO_VERSION: '1.22'
|
2023-12-26 20:49:47 +01:00
|
|
|
|
2023-08-03 01:47:26 +02:00
|
|
|
jobs:
|
2023-12-26 21:49:48 +01:00
|
|
|
merge_release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Merge development -> staging
|
|
|
|
uses: devmasx/merge-branch@master
|
|
|
|
with:
|
|
|
|
type: now
|
|
|
|
from_branch: main
|
|
|
|
target_branch: release
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2023-12-23 14:03:38 +01:00
|
|
|
build_linux:
|
2023-08-03 01:47:26 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v4
|
|
|
|
with:
|
2023-12-26 20:49:47 +01:00
|
|
|
go-version: ${{ env.GO_VERSION }}
|
2024-05-04 01:06:24 +02:00
|
|
|
- name: Write version
|
2024-05-04 05:43:57 +02:00
|
|
|
run: echo "${{ github.event.release.tag_name }}" > ./cli/cmd/version.txt
|
2023-08-03 01:47:26 +02:00
|
|
|
- name: Install libfido2-dev
|
|
|
|
run: sudo apt-get install -y libfido2-dev
|
2023-12-26 20:49:47 +01:00
|
|
|
- name: Build
|
2023-09-20 00:41:43 +02:00
|
|
|
run: go build -o goldwarden_linux_x86_64 -v .
|
2023-08-21 20:02:08 +02:00
|
|
|
- uses: AButler/upload-release-assets@v2.0
|
|
|
|
with:
|
2023-12-26 20:49:47 +01:00
|
|
|
files: './goldwarden_linux_x86_64'
|
2023-08-21 20:02:08 +02:00
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2023-09-20 00:41:43 +02:00
|
|
|
- name: Move binaries to directories
|
|
|
|
run: |
|
2023-09-20 03:06:09 +02:00
|
|
|
mkdir -p .debpkg/usr/bin
|
2023-09-20 00:41:43 +02:00
|
|
|
mkdir -p .rpmpkg/usr/bin
|
|
|
|
cp -p goldwarden_linux_x86_64 .debpkg/usr/bin/goldwarden
|
|
|
|
cp -p goldwarden_linux_x86_64 .rpmpkg/usr/bin/goldwarden
|
2023-09-20 03:06:09 +02:00
|
|
|
mkdir -p .debpkg/usr/share/polkit-1/actions/
|
|
|
|
mkdir -p .rpmpkg/usr/share/polkit-1/actions/
|
2024-05-04 05:43:57 +02:00
|
|
|
cp -p cli/resources/com.quexten.goldwarden.policy .debpkg/usr/share/polkit-1/actions/
|
|
|
|
cp -p cli/resources/com.quexten.goldwarden.policy .rpmpkg/usr/share/polkit-1/actions/
|
2023-09-20 00:41:43 +02:00
|
|
|
- uses: jiro4989/build-deb-action@v3
|
|
|
|
with:
|
|
|
|
package: goldwarden
|
|
|
|
package_root: .debpkg
|
|
|
|
maintainer: quexten
|
|
|
|
version: ${{ github.ref }}
|
|
|
|
arch: 'amd64'
|
|
|
|
desc: 'Goldwarden'
|
2023-09-20 00:58:06 +02:00
|
|
|
- uses: AButler/upload-release-assets@v3.0
|
2023-09-20 00:41:43 +02:00
|
|
|
with:
|
|
|
|
files: './*.deb'
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- uses: jiro4989/build-rpm-action@v2
|
|
|
|
with:
|
|
|
|
summary: 'Goldwarden'
|
|
|
|
package: goldwarden
|
|
|
|
package_root: .rpmpkg
|
|
|
|
maintainer: quexten
|
|
|
|
version: ${{ github.ref }}
|
|
|
|
arch: 'x86_64'
|
|
|
|
desc: 'Goldwarden'
|
2023-09-20 00:58:06 +02:00
|
|
|
- name: Move binaries to directories
|
|
|
|
run:
|
|
|
|
"rm ./goldwarden-debuginfo*"
|
2023-09-20 00:41:43 +02:00
|
|
|
- uses: AButler/upload-release-assets@v2.0
|
|
|
|
with:
|
|
|
|
files: './*.rpm'
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2023-12-26 20:49:47 +01:00
|
|
|
build_linux_arm64:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2024-05-04 01:06:24 +02:00
|
|
|
- name: Write version
|
2024-05-04 05:43:57 +02:00
|
|
|
run: echo "${{ github.event.release.tag_name }}" > ./cli/cmd/version.txt
|
2023-12-26 20:49:47 +01:00
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v4
|
|
|
|
with:
|
|
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
- name: Build
|
|
|
|
run: GOARCH=arm64 go build -tags nofido2 -o goldwarden_linux_arm64 -v .
|
|
|
|
- uses: AButler/upload-release-assets@v2.0
|
|
|
|
with:
|
|
|
|
files: './goldwarden_linux_arm64'
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
build_linux_x86:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2024-05-04 01:06:24 +02:00
|
|
|
- name: Write version
|
2024-05-04 05:43:57 +02:00
|
|
|
run: echo "${{ github.event.release.tag_name }}" > ./cli/cmd/version.txt
|
2023-12-26 20:49:47 +01:00
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v4
|
|
|
|
with:
|
|
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
- name: Build
|
|
|
|
run: GOARCH=386 go build -tags nofido2 -o goldwarden_linux_x86 -v .
|
|
|
|
- uses: AButler/upload-release-assets@v2.0
|
|
|
|
with:
|
|
|
|
files: './goldwarden_linux_x86'
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2023-09-19 23:47:58 +02:00
|
|
|
build_macos_x86_64:
|
|
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v1
|
2024-05-04 01:06:24 +02:00
|
|
|
- name: Write version
|
2024-05-04 05:43:57 +02:00
|
|
|
run: echo "${{ github.event.release.tag_name }}" > ./cli/cmd/version.txt
|
2023-09-19 23:47:58 +02:00
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v4
|
|
|
|
with:
|
2024-04-28 18:10:54 +02:00
|
|
|
go-version: ${{ env.GO_VERSION }}
|
2024-02-04 10:08:51 +01:00
|
|
|
- name: Set up Homebrew
|
|
|
|
id: set-up-homebrew
|
|
|
|
uses: Homebrew/actions/setup-homebrew@master
|
|
|
|
- name: Fido2
|
|
|
|
run: brew install libfido2
|
2023-09-19 23:47:58 +02:00
|
|
|
- name: Build
|
2024-02-04 10:08:51 +01:00
|
|
|
run: go build -o "goldwarden_macos_x86_64" -v .
|
2023-09-20 00:41:43 +02:00
|
|
|
- uses: AButler/upload-release-assets@v2.0
|
2023-09-19 23:47:58 +02:00
|
|
|
with:
|
2023-09-20 00:58:06 +02:00
|
|
|
files: './goldwarden_macos_x86_64'
|
2023-09-20 00:41:43 +02:00
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2023-08-21 00:47:40 +02:00
|
|
|
|
2024-02-03 20:28:07 +01:00
|
|
|
build_macos_aarch64:
|
|
|
|
runs-on: macos-14
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v1
|
2024-05-04 01:06:24 +02:00
|
|
|
- name: Write version
|
2024-05-04 05:43:57 +02:00
|
|
|
run: echo "${{ github.event.release.tag_name }}" > ./cli/cmd/version.txt
|
2024-02-03 20:28:07 +01:00
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v4
|
|
|
|
with:
|
2024-04-28 18:10:54 +02:00
|
|
|
go-version: ${{ env.GO_VERSION }}
|
2024-02-04 10:08:51 +01:00
|
|
|
- name: Set up Homebrew
|
|
|
|
id: set-up-homebrew
|
|
|
|
uses: Homebrew/actions/setup-homebrew@master
|
|
|
|
- name: Fido2
|
|
|
|
run: brew install libfido2
|
2024-02-03 20:28:07 +01:00
|
|
|
- name: Build
|
2024-02-04 10:08:51 +01:00
|
|
|
run: go build -o "goldwarden_macos_aarch64" -v .
|
2024-02-03 20:28:07 +01:00
|
|
|
- uses: AButler/upload-release-assets@v2.0
|
|
|
|
with:
|
|
|
|
files: './goldwarden_macos_aarch64'
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2023-09-19 23:47:58 +02:00
|
|
|
build_windows_x86_64:
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v1
|
2024-05-04 01:06:24 +02:00
|
|
|
- name: Write version
|
2024-05-04 05:43:57 +02:00
|
|
|
run: echo "${{ github.event.release.tag_name }}" > ./cli/cmd/version.txt
|
2023-09-19 23:47:58 +02:00
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v4
|
|
|
|
with:
|
2024-04-28 18:10:54 +02:00
|
|
|
go-version: ${{ env.GO_VERSION }}
|
2024-02-04 10:08:51 +01:00
|
|
|
- uses: MinoruSekine/setup-scoop@v2
|
|
|
|
- name: Fido2
|
|
|
|
run: |
|
|
|
|
scoop bucket add keys.pub https://github.com/keys-pub/scoop-bucket
|
|
|
|
scoop install libfido2
|
2023-09-19 23:47:58 +02:00
|
|
|
- name: Build
|
2024-02-04 10:08:51 +01:00
|
|
|
run: go build -o "goldwarden_windows_x86_64.exe" -v .
|
2023-09-20 00:41:43 +02:00
|
|
|
- uses: AButler/upload-release-assets@v2.0
|
2023-09-19 23:47:58 +02:00
|
|
|
with:
|
2023-09-20 00:41:43 +02:00
|
|
|
files: './goldwarden_windows_x86_64.exe'
|
2023-12-23 14:03:38 +01:00
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2024-02-04 10:12:11 +01:00
|
|
|
|
|
|
|
build_windows_aarch64:
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v1
|
2024-05-04 01:06:24 +02:00
|
|
|
- name: Write version
|
2024-05-04 05:43:57 +02:00
|
|
|
run: echo "${{ github.event.release.tag_name }}" > ./cli/cmd/version.txt
|
2024-02-04 10:12:11 +01:00
|
|
|
- name: Set up Go
|
|
|
|
uses: actions/setup-go@v4
|
|
|
|
with:
|
2024-04-28 18:10:54 +02:00
|
|
|
go-version: ${{ env.GO_VERSION }}
|
2024-02-04 10:12:11 +01:00
|
|
|
- name: Build
|
2024-02-04 10:21:58 +01:00
|
|
|
run: set GOARCH=arm64 && go build -tags nofido2 -o "goldwarden_windows_aarch64.exe" -v .
|
2024-02-04 10:12:11 +01:00
|
|
|
- uses: AButler/upload-release-assets@v2.0
|
|
|
|
with:
|
|
|
|
files: './goldwarden_windows_aarch64.exe'
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2024-05-04 01:06:24 +02:00
|
|
|
|
|
|
|
publish_to_aur:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v1
|
|
|
|
- name: Write version
|
2024-05-04 01:31:47 +02:00
|
|
|
run: echo "${GITHUB_REF#refs/tags/}" > ./cli/cmd/version.txt
|
2024-05-04 06:10:20 +02:00
|
|
|
- name: Write release version
|
|
|
|
run: |
|
|
|
|
VERSION=${GITHUB_REF_NAME#v}
|
|
|
|
echo Version: $VERSION
|
|
|
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
2024-05-04 01:06:24 +02:00
|
|
|
- name: Replace version in PKGBUILD
|
2024-05-04 06:10:20 +02:00
|
|
|
run: sed -i "s/pkgver=.*/pkgver=${VERSION}/" ./.github/workflows/PKGBUILD
|
2024-05-04 01:06:24 +02:00
|
|
|
- name: Publish AUR package
|
|
|
|
uses: KSXGitHub/github-actions-deploy-aur@v2.7.0
|
|
|
|
with:
|
|
|
|
pkgname: goldwarden
|
|
|
|
updpkgsums: true
|
|
|
|
pkgbuild: ./.github/workflows/PKGBUILD
|
|
|
|
commit_username: ${{ secrets.AUR_USERNAME }}
|
|
|
|
commit_email: ${{ secrets.AUR_EMAIL }}
|
|
|
|
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
|
|
|
commit_message: Update AUR package from GitHub Actions automation
|
2024-05-04 05:43:57 +02:00
|
|
|
ssh_keyscan_types: ed25519
|