Skip to content

Commit

Permalink
Add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
wginolas committed Jan 20, 2025
1 parent e166ec8 commit a0c1627
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 8 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/github-actions-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Checks
run-name: Checking ${{ github.ref }}
on: [push]
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Mount bazel cache
uses: actions/cache@v3
with:
path: "/home/runner/.cache/bazel"
key: bazel

- name: bazel test
run: |
bazel test ...
- name: bazel build :oofork
run: |
bazel build :oofork
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./mbazel-bin/onlyoffice-editor.tar.gz
asset_name: onlyoffice-editor.tar.gz
asset_content_type: application/zip
12 changes: 4 additions & 8 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_pkg//pkg:zip.bzl", "pkg_zip")
load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix")
load("@rules_gzip//gzip/compress:defs.bzl", "gzip_compress")

Expand All @@ -25,9 +26,9 @@ pkg_files(
strip_prefix = strip_prefix.from_pkg("make"),
)

pkg_tar(
name = "oofork-tar",
package_file_name = "onlyoffice-editor.tar",
pkg_zip(
name = "oofork",
package_file_name = "onlyoffice-editor.zip",
srcs = [
"//:editor-in-fork",
"//:client-in-fork",
Expand All @@ -37,11 +38,6 @@ pkg_tar(
visibility = ["//visibility:public"],
)

gzip_compress(
name = "oofork",
src = "//:oofork-tar",
)

sh_test( # TODO can I use this here? https://docs.aspect.build/rulesets/aspect_bazel_lib/docs/testing#assert_directory_contains
name = "oofork-files-test",
size = "small",
Expand Down

0 comments on commit a0c1627

Please sign in to comment.