Skip to content

Commit

Permalink
Merge pull request #64 from JankariTech/ci/publish-release-artifacts
Browse files Browse the repository at this point in the history
ci: upload production ready extension artifacts as the release assets
  • Loading branch information
saw-jan authored Jul 18, 2024
2 parents 6f4d5e5 + 55b6f4e commit 0c27582
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
name: lint-build-e2e
name: lint-and-tests

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
push:
branches:
- main
pull_request:
workflow_call:

env:
OCIS_URL: https://localhost:9200

jobs:
ci:
lint-and-tests:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4

- name: pnpm-install
uses: pnpm/action-setup@v3
uses: pnpm/action-setup@v4
with:
run_install: |
- args: [--frozen-lockfile, --strict-peer-dependencies]
Expand All @@ -28,6 +33,14 @@ jobs:
- name: build
run: pnpm build

- name: upload-dist
uses: actions/upload-artifact@v4
if: github.event_name == 'release'
with:
name: dist
path: dist/
retention-days: 1

- name: ocis-server
run: |
docker run --rm -d \
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: release

on:
release:
types: [published]

jobs:
ci:
uses: ./.github/workflows/ci.yml

publish-artifacts:
needs: [ci]
runs-on: ubuntu-latest
steps:
- name: download-dist
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: create-artifacts
run: |
(cd dist && zip -r - .) >mdpresentation-${{ github.ref_name }}.zip
mkdir -p dist/release
mv mdpresentation-${{ github.ref_name }}.zip dist/release/
md5sum dist/release/mdpresentation-${{ github.ref_name }}.zip >dist/release/md5sum.txt
sha256sum dist/release/mdpresentation-${{ github.ref_name }}.zip >dist/release/sha256sum.txt
- name: publish-artifacts
uses: fnkr/github-action-ghr@v1
env:
GHR_PATH: dist/release/
GHR_REPLACE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 0c27582

Please sign in to comment.