mirror of
https://github.com/go-vikunja/vikunja.git
synced 2025-12-05 19:16:51 -06:00
397 lines
14 KiB
YAML
397 lines
14 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: blacksmith-4vcpu-ubuntu-2204
|
|
steps:
|
|
- name: Git describe
|
|
id: ghd
|
|
uses: proudust/gh-describe@v2
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
- name: Login to GHCR
|
|
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3
|
|
with:
|
|
version: latest
|
|
- name: Docker meta version
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
id: meta
|
|
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5
|
|
with:
|
|
images: |
|
|
vikunja/vikunja
|
|
ghcr.io/go-vikunja/vikunja
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
type=raw,value=latest
|
|
- name: Build and push unstable
|
|
if: ${{ github.ref_type != 'tag' }}
|
|
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6
|
|
with:
|
|
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
|
|
push: true
|
|
tags: |
|
|
vikunja/vikunja:unstable
|
|
ghcr.io/go-vikunja/vikunja:unstable
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
build-args: |
|
|
RELEASE_VERSION=${{ steps.ghd.outputs.describe }}
|
|
- name: Build and push version
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6
|
|
with:
|
|
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
build-args: |
|
|
RELEASE_VERSION=${{ steps.ghd.outputs.describe }}
|
|
|
|
binaries:
|
|
runs-on: blacksmith-8vcpu-ubuntu-2204
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
- name: Git describe
|
|
id: ghd
|
|
uses: proudust/gh-describe@v2
|
|
- uses: useblacksmith/setup-go@647ac649bd5b480f2a262e3e3e5f4d150ed452ad # v6
|
|
with:
|
|
go-version: stable
|
|
- name: Download Mage Binary
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: mage_bin
|
|
- name: get frontend
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: frontend_dist
|
|
path: frontend/dist
|
|
- run: chmod +x ./mage-static
|
|
- name: install upx
|
|
run: |
|
|
wget https://github.com/upx/upx/releases/download/v5.0.0/upx-5.0.0-amd64_linux.tar.xz
|
|
echo 'b32abf118d721358a50f1aa60eacdbf3298df379c431c3a86f139173ab8289a1 upx-5.0.0-amd64_linux.tar.xz' > upx-5.0.0-amd64_linux.tar.xz.sha256
|
|
sha256sum -c upx-5.0.0-amd64_linux.tar.xz.sha256
|
|
tar xf upx-5.0.0-amd64_linux.tar.xz
|
|
mv upx-5.0.0-amd64_linux/upx /usr/local/bin
|
|
- name: GPG setup
|
|
uses: kolaente/action-gpg@main
|
|
with:
|
|
gpg-passphrase: "${{ secrets.RELEASE_GPG_PASSPHRASE }}"
|
|
gpg-sign-key: "${{ secrets.RELEASE_GPG_SIGN_KEY }}"
|
|
- name: setup xgo cache
|
|
uses: useblacksmith/cache@71c7c918062ba3861252d84b07fe5ab2a6b467a6 # v5
|
|
with:
|
|
path: /home/runner/.xgo-cache
|
|
key: ${{ hashFiles('**/go.sum') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-go-
|
|
- name: build and release
|
|
env:
|
|
RELEASE_VERSION: ${{ steps.ghd.outputs.describe }}
|
|
XGO_OUT_NAME: vikunja-${{ github.ref_type == 'tag' && steps.ghd.outputs.describe || 'unstable' }}
|
|
run: |
|
|
export PATH=$PATH:$GOPATH/bin
|
|
./mage-static release
|
|
- name: sign
|
|
run: |
|
|
ls -hal dist/zip/*
|
|
for file in dist/zip/*; do
|
|
gpg -v --default-key 7D061A4AA61436B40713D42EFF054DACD908493A -b --batch --yes --passphrase "${{ secrets.RELEASE_GPG_PASSPHRASE }}" --pinentry-mode loopback --sign "$file"
|
|
done
|
|
- name: Upload
|
|
uses: kolaente/s3-action@41963184b524ccac734ea4d8c964ac74b5b1af89 # v1.2.1
|
|
with:
|
|
s3-access-key-id: ${{ secrets.S3_ACCESS_KEY }}
|
|
s3-secret-access-key: ${{ secrets.S3_SECRET_KEY }}
|
|
s3-endpoint: ${{ secrets.S3_ENDPOINT }}
|
|
s3-bucket: ${{ secrets.S3_BUCKET }}
|
|
s3-region: ${{ secrets.S3_REGION }}
|
|
target-path: /vikunja/${{ github.ref_type == 'tag' && steps.ghd.outputs.describe || 'unstable' }}
|
|
files: "dist/zip/*"
|
|
strip-path-prefix: dist/zip/
|
|
- name: Store Binaries
|
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
|
with:
|
|
name: vikunja_bins
|
|
path: ./dist/binaries/*
|
|
- name: Store Binary Packages
|
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
with:
|
|
name: vikunja_bin_packages
|
|
path: ./dist/zip/*
|
|
|
|
os-package:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- binaries
|
|
strategy:
|
|
matrix:
|
|
package:
|
|
- rpm
|
|
- deb
|
|
- apk
|
|
- archlinux
|
|
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
- name: Download Vikunja Binary
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: vikunja_bins
|
|
pattern: vikunja-*-linux-amd64
|
|
- name: Git describe
|
|
id: ghd
|
|
uses: proudust/gh-describe@v2
|
|
- name: Download Mage Binary
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: mage_bin
|
|
- name: Prepare
|
|
env:
|
|
RELEASE_VERSION: ${{ steps.ghd.outputs.describe }}
|
|
run: |
|
|
chmod +x ./mage-static
|
|
./mage-static release:prepare-nfpm-config
|
|
mkdir -p ./dist/os-packages
|
|
mv ./vikunja-*-linux-amd64 ./vikunja
|
|
chmod +x ./vikunja
|
|
- name: Create package
|
|
id: nfpm
|
|
uses: kolaente/action-gh-nfpm@master
|
|
with:
|
|
packager: ${{ matrix.package }}
|
|
target: ./dist/os-packages/vikunja-${{ github.ref_type == 'tag' && steps.ghd.outputs.describe || 'unstable' }}-x86_64.${{ matrix.package }}
|
|
config: ./nfpm.yaml
|
|
- name: Upload
|
|
uses: kolaente/s3-action@41963184b524ccac734ea4d8c964ac74b5b1af89 # v1.2.1
|
|
with:
|
|
s3-access-key-id: ${{ secrets.S3_ACCESS_KEY }}
|
|
s3-secret-access-key: ${{ secrets.S3_SECRET_KEY }}
|
|
s3-endpoint: ${{ secrets.S3_ENDPOINT }}
|
|
s3-bucket: ${{ secrets.S3_BUCKET }}
|
|
s3-region: ${{ secrets.S3_REGION }}
|
|
target-path: /vikunja/${{ github.ref_type == 'tag' && steps.ghd.outputs.describe || 'unstable' }}
|
|
files: "dist/os-packages/*"
|
|
strip-path-prefix: dist/os-packages/
|
|
- name: Store OS Packages
|
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
with:
|
|
name: vikunja_os_package_${{ matrix.package }}
|
|
path: ./dist/os-packages/*
|
|
|
|
config-yaml:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
- name: Git describe
|
|
id: ghd
|
|
uses: proudust/gh-describe@v2
|
|
- name: Download Mage Binary
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: mage_bin
|
|
- name: generate
|
|
run: |
|
|
chmod +x ./mage-static
|
|
./mage-static generate:config-yaml 1
|
|
- name: Upload to S3
|
|
uses: kolaente/s3-action@41963184b524ccac734ea4d8c964ac74b5b1af89 # v1.2.1
|
|
with:
|
|
s3-access-key-id: ${{ secrets.S3_ACCESS_KEY }}
|
|
s3-secret-access-key: ${{ secrets.S3_SECRET_KEY }}
|
|
s3-endpoint: ${{ secrets.S3_ENDPOINT }}
|
|
s3-bucket: ${{ secrets.S3_BUCKET }}
|
|
s3-region: ${{ secrets.S3_REGION }}
|
|
target-path: /vikunja/${{ github.ref_type == 'tag' && steps.ghd.outputs.describe || 'unstable' }}
|
|
files: "config.yml.sample"
|
|
|
|
desktop:
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- windows-latest
|
|
- macos-latest
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
- name: Git describe
|
|
id: ghd
|
|
uses: proudust/gh-describe@v2
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4
|
|
with:
|
|
package_json_file: desktop/package.json
|
|
- name: Setup Node
|
|
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
|
|
with:
|
|
node-version-file: frontend/.nvmrc
|
|
cache: pnpm
|
|
cache-dependency-path: desktop/pnpm-lock.yaml
|
|
- name: Install Linux dependencies
|
|
if: ${{ runner.os == 'Linux' }}
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install --no-install-recommends -y libopenjp2-tools rpm libarchive-tools
|
|
- name: get frontend
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: frontend_dist
|
|
path: frontend/dist
|
|
- name: Build desktop app
|
|
working-directory: desktop
|
|
run: |
|
|
pnpm install --frozen-lockfile --prefer-offline --fetch-timeout 100000
|
|
node build.js "${{ steps.ghd.outputs.describe }}" ${{ github.ref_type == 'tag' }}
|
|
- name: Upload to S3
|
|
uses: kolaente/s3-action@41963184b524ccac734ea4d8c964ac74b5b1af89 # v1.2.1
|
|
with:
|
|
s3-access-key-id: ${{ secrets.S3_ACCESS_KEY }}
|
|
s3-secret-access-key: ${{ secrets.S3_SECRET_KEY }}
|
|
s3-endpoint: ${{ secrets.S3_ENDPOINT }}
|
|
s3-bucket: ${{ secrets.S3_BUCKET }}
|
|
s3-region: ${{ secrets.S3_REGION }}
|
|
files: "desktop/dist/Vikunja*"
|
|
target-path: /desktop/${{ github.ref_type == 'tag' && steps.ghd.outputs.describe || 'unstable' }}
|
|
strip-path-prefix: desktop/dist/
|
|
exclude: "desktop/dist/*.blockmap"
|
|
- name: Store Desktop Package
|
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
with:
|
|
name: vikunja_desktop_packages_${{ matrix.os }}
|
|
path: |
|
|
./desktop/dist/Vikunja*
|
|
!./desktop/dist/*.blockmap
|
|
|
|
generate-swagger-docs:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
|
|
with:
|
|
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
persist-credentials: true
|
|
- name: Download Mage Binary
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: mage_bin
|
|
- name: Set up Go
|
|
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
|
|
with:
|
|
go-version: stable
|
|
- name: generate
|
|
run: |
|
|
export PATH=$PATH:$GOPATH/bin
|
|
go install github.com/swaggo/swag/cmd/swag
|
|
chmod +x ./mage-static
|
|
./mage-static generate:swagger-docs
|
|
- name: Check for changes
|
|
id: check_changes
|
|
run: |
|
|
if git diff --quiet; then
|
|
echo "changes_exist=0" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "changes_exist=1" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
- name: Commit files
|
|
if: steps.check_changes.outputs.changes_exist != '0'
|
|
run: |
|
|
git config --local user.email "bot@vikunja.io"
|
|
git config --local user.name "Frederick [Bot]"
|
|
git commit -am "[skip ci] Updated swagger docs"
|
|
- name: Push changes
|
|
if: steps.check_changes.outputs.changes_exist != '0'
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
ssh: true
|
|
branch: ${{ github.ref }}
|
|
|
|
create-release:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- binaries
|
|
- os-package
|
|
- desktop
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Download Binaries
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: vikunja_bin_packages
|
|
|
|
- name: Download OS Package rpm
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: vikunja_os_package_rpm
|
|
|
|
- name: Download OS Package deb
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: vikunja_os_package_deb
|
|
|
|
- name: Download OS Package apk
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: vikunja_os_package_apk
|
|
|
|
- name: Download OS Package archlinux
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: vikunja_os_package_archlinux
|
|
|
|
- name: Download Desktop Package Linux
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: vikunja_desktop_packages_ubuntu-latest
|
|
|
|
- name: Download Desktop Package MacOS
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: vikunja_desktop_packages_macos-latest
|
|
|
|
- name: Download Desktop Package Windows
|
|
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
|
|
with:
|
|
name: vikunja_desktop_packages_windows-latest
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe # v2
|
|
if: github.ref_type == 'tag'
|
|
with:
|
|
draft: true
|
|
files: |
|
|
vikunja*.zip
|
|
vikunja*.rpm
|
|
vikunja*.deb
|
|
vikunja*.apk
|
|
vikunja*.archlinux
|
|
Vikunja Desktop*
|