Skip to content

Commit

Permalink
ci: test reuses workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ChugunovRoman committed Nov 12, 2023
1 parent 95b8e43 commit ed4788f
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Build
name: Old Main

on:
create:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release Build

on: workflow_dispatch

jobs:
setup:
uses: ./.github/workflows/reuses/setup.yml

build_arm64v8:
uses: ./.github/workflows/reuses/build_arm64v8.yml
needs: setup
build_amd64:
uses: ./.github/workflows/reuses/build_amd64.yml
needs: setup

release_arm64v8:
uses: ./.github/workflows/reuses/release_arm64v8.yml
needs: build_arm64v8
release_amd64:
uses: ./.github/workflows/reuses/release_amd64.yml
needs: build_amd64
37 changes: 37 additions & 0 deletions .github/workflows/reuses/build_amd64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build amd64

on: workflow_call

jobs:
build_amd64:
runs-on: ubuntu-latest
name: build for amd64
steps:
- uses: actions/download-artifact@v3
with:
name: repo
path: ./

- name: Setup
run: |
chmod +wr . -R
chmod +x ./**/*.sh
chmod +x ./**/*.pl
- name: Build in Docker
id: build
run: |
docker build -t figma-linux-artefacts -f "./docker/Build_artefacts_local" --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) .
mkdir -p ./build/installers
docker cp $(docker create figma-linux-artefacts:latest)://usr/src/figma-linux/build/installers/. ./build/installers
mv ./build/installers/figma-linux_$(cat build/installers/version)_linux_x64.zip ./build/installers/figma-linux_$(cat build/installers/version)_linux_amd64.zip
perl ./scripts/generate_release_notes.pl
- name: Cache amd64 artifacts
id: cache-amd64-artifacts
uses: actions/upload-artifact@v3
with:
name: amd64
path: |
./release_notes
build/installers/*
40 changes: 40 additions & 0 deletions .github/workflows/reuses/build_arm64v8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build arm64v8

on: workflow_call

jobs:
build_arm64v8:
name: build for arm64v8
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: repo
path: ./

- name: Setup
run: |
chmod +wr . -R
chmod +x ./**/*.sh
chmod +x ./**/*.pl
- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build in Docker
id: build
run: |
docker buildx build --platform linux/arm64 -t 4tqrgqe5yrgfd/figma-linux-artefacts-arm --load -f ./docker/Build_artefacts_arm64v8 .
mkdir -p ./build/installers
docker cp $(docker create 4tqrgqe5yrgfd/figma-linux-artefacts-arm)://usr/src/figma-linux/build/installers/. ./build/installers
perl ./scripts/generate_release_notes.pl
- name: Cache arm64v8 artifacts
id: cache-arm64v8-artifacts
uses: actions/upload-artifact@v3
with:
name: arm64v8
path: build/installers/*
34 changes: 34 additions & 0 deletions .github/workflows/reuses/release_amd64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish release amd64

on: workflow_call

jobs:
release_amd64:
name: Upload amd64 assets
runs-on: ubuntu-latest
steps:
- name: mkdir installers
run: mkdir -p ./build/installers

- uses: actions/download-artifact@v3
with:
name: amd64
path: ./

- name: Get version
id: version
run: |
echo ::set-output name=release::$(cat build/installers/version)
sha256sum ./build/installers/figma-linux* || echo ""
ls -la .
# - name: Upload release assets
# id: release
# uses: ChugunovRoman/action-gh-release@master
# if: startsWith(github.ref, 'refs/tags/')
# with:
# body_path: ./release_notes
# name: Figma Linux ${{ steps.version.outputs.release }}
# files: build/installers/figma-linux*
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/reuses/release_arm64v8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish release arm64v8

on: workflow_call

jobs:
release_arm64v8:
name: Upload arm64v8 assets
runs-on: ubuntu-latest
steps:
- name: mkdir installers
run: mkdir -p ./build/installers

- uses: actions/download-artifact@v3
with:
name: arm64v8
path: ./build/installers

- name: Get version
id: version
run: |
echo ::set-output name=release::$(cat build/installers/version)
sha256sum ./build/installers/figma-linux* || echo ""
ls -la .
# - name: Upload release assets
# id: release
# uses: ChugunovRoman/action-gh-release@master
# if: startsWith(github.ref, 'refs/tags/')
# with:
# name: Figma Linux ${{ steps.version.outputs.release }}
# files: build/installers/figma-linux*
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/reuses/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Setup

on: workflow_call

jobs:
setup:
name: Setup
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache src
uses: actions/upload-artifact@v3
with:
name: repo
path: ./*

0 comments on commit ed4788f

Please sign in to comment.