mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-24 22:25:15 +00:00
346 lines
11 KiB
YAML
346 lines
11 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
mage:
|
|
runs-on: ubuntu-latest
|
|
name: prepare-mage
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: stable
|
|
- name: Cache Mage
|
|
id: cache-mage
|
|
uses: actions/cache@v4
|
|
with:
|
|
key: ${{ runner.os }}-build-mage-${{ hashFiles('magefile.go') }}
|
|
path: |
|
|
./mage-static
|
|
- name: Compile Mage
|
|
if: ${{ steps.cache-mage.outputs.cache-hit != 'true' }}
|
|
uses: magefile/mage-action@v3
|
|
with:
|
|
version: latest
|
|
args: -compile ./mage-static
|
|
- name: Store Mage Binary
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: mage_bin
|
|
path: ./mage-static
|
|
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Git describe
|
|
id: ghd
|
|
uses: proudust/gh-describe@v2
|
|
- name: Login to GHCR
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_HUB_USERNAME }}
|
|
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
- name: Docker meta version
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
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@v6
|
|
with:
|
|
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64/v8
|
|
push: true
|
|
tags: vikunja/vikunja:unstable
|
|
build-args: |
|
|
RELEASE_VERSION=${{ steps.ghd.outputs.describe }}
|
|
- name: Build and push version
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
uses: docker/build-push-action@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 }}
|
|
build-args: |
|
|
RELEASE_VERSION=${{ steps.ghd.outputs.describe }}
|
|
|
|
frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
name: Install pnpm
|
|
with:
|
|
run_install: false
|
|
package_json_file: frontend/package.json
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: 'pnpm'
|
|
cache-dependency-path: frontend/pnpm-lock.yaml
|
|
- name: Install dependencies
|
|
working-directory: frontend
|
|
run: |
|
|
pnpm install
|
|
pnpm build
|
|
- name: Store frontend dist
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: frontend_dist
|
|
path: ./frontend/dist/**/*
|
|
|
|
binaries:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- mage
|
|
- frontend
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Git describe
|
|
id: ghd
|
|
uses: proudust/gh-describe@v2
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: stable
|
|
- name: Download Mage Binary
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: mage_bin
|
|
- name: get frontend
|
|
uses: actions/download-artifact@v4
|
|
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: 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@v1.0.1
|
|
with:
|
|
s3-access-key-id: ${{ secrets.HETZNER_S3_ACCESS_KEY }}
|
|
s3-secret-access-key: ${{ secrets.HETZNER_S3_SECRET_KEY }}
|
|
s3-endpoint: 'https://fsn1.your-objectstorage.com'
|
|
s3-bucket: 'vikunja'
|
|
s3-region: 'fsn1'
|
|
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@v4
|
|
with:
|
|
name: vikunja_bins
|
|
path: ./dist/binaries/*
|
|
|
|
os-package:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- binaries
|
|
strategy:
|
|
matrix:
|
|
package:
|
|
- rpm
|
|
- deb
|
|
- apk
|
|
- archlinux
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Download Vikunja Binary
|
|
uses: actions/download-artifact@v4
|
|
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@v4
|
|
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@v1.0.1
|
|
with:
|
|
s3-access-key-id: ${{ secrets.HETZNER_S3_ACCESS_KEY }}
|
|
s3-secret-access-key: ${{ secrets.HETZNER_S3_SECRET_KEY }}
|
|
s3-endpoint: 'https://fsn1.your-objectstorage.com'
|
|
s3-bucket: 'vikunja'
|
|
s3-region: 'fsn1'
|
|
target-path: /vikunja/${{ github.ref_type == 'tag' && steps.ghd.outputs.describe || 'unstable' }}
|
|
files: 'dist/os-packages/*'
|
|
strip-path-prefix: dist/os-packages/
|
|
|
|
config-yaml:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- mage
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Git describe
|
|
id: ghd
|
|
uses: proudust/gh-describe@v2
|
|
- name: Download Mage Binary
|
|
uses: actions/download-artifact@v4
|
|
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@v1.0.1
|
|
with:
|
|
s3-access-key-id: ${{ secrets.HETZNER_S3_ACCESS_KEY }}
|
|
s3-secret-access-key: ${{ secrets.HETZNER_S3_SECRET_KEY }}
|
|
s3-endpoint: 'https://fsn1.your-objectstorage.com'
|
|
s3-bucket: 'vikunja'
|
|
s3-region: 'fsn1'
|
|
target-path: /vikunja/${{ github.ref_type == 'tag' && steps.ghd.outputs.describe || 'unstable' }}
|
|
files: 'config.yml.sample'
|
|
|
|
desktop:
|
|
needs:
|
|
- frontend
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- windows-latest
|
|
- macos-latest
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Git describe
|
|
id: ghd
|
|
uses: proudust/gh-describe@v2
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
package_json_file: desktop/package.json
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
cache-dependency-path: desktop/pnpm-lock.yaml
|
|
- name: Install Linux dependencies
|
|
if: ${{ runner.os == 'Linux' }}
|
|
run: sudo apt-get install --no-install-recommends -y libopenjp2-tools rpm libarchive-tools
|
|
- name: get frontend
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: frontend_dist
|
|
path: frontend/dist
|
|
- name: Build desktop app
|
|
working-directory: desktop
|
|
run: |
|
|
pnpm install --fetch-timeout 100000
|
|
node build.js "${{ steps.ghd.outputs.describe }}" ${{ github.ref_type == 'tag' }}
|
|
- name: Upload to S3
|
|
uses: kolaente/s3-action@v1.0.1
|
|
with:
|
|
s3-access-key-id: ${{ secrets.HETZNER_S3_ACCESS_KEY }}
|
|
s3-secret-access-key: ${{ secrets.HETZNER_S3_SECRET_KEY }}
|
|
s3-endpoint: 'https://fsn1.your-objectstorage.com'
|
|
s3-bucket: 'vikunja'
|
|
s3-region: 'fsn1'
|
|
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'
|
|
|
|
generate-swagger-docs:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
needs:
|
|
- mage
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Download Mage Binary
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: mage_bin
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
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: |
|
|
git diff --quiet
|
|
echo "changes_exist=$?" >> "$GITHUB_OUTPUT"
|
|
- name: Commit files
|
|
if: steps.check_changes.outputs.changes_exist != '0'
|
|
run: |
|
|
git config --local user.email "frederik@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:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: ${{ github.ref }}
|