Browse Source

chore: upload assets to the latest draft release

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2471/head
Pranav C 2 years ago
parent
commit
fee3e004a0
  1. 120
      .github/workflows/release-executables.yml

120
.github/workflows/release-executables.yml

@ -21,6 +21,17 @@ jobs:
build-executables: build-executables:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# Get the latest draft release for asset upload url
- uses: cardinalby/git-get-release-action@v1
id: get_release
env:
GITHUB_TOKEN: ${{ secrets.NC_GITHUB_TOKEN }}
with:
latest: 1
draft: true
# Store upload url to access across jobs
- run: |
echo "::set-output name=UPLOAD_URL::${{ steps.get_release.outputs.upload_url }}"
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Cache node modules - name: Cache node modules
id: cache-npm id: cache-npm
@ -35,6 +46,7 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build- ${{ runner.os }}-build-
${{ runner.os }}- ${{ runner.os }}-
- name: Cache pkg modules - name: Cache pkg modules
id: cache-pkg id: cache-pkg
uses: actions/cache@v3 uses: actions/cache@v3
@ -97,6 +109,51 @@ jobs:
overwrite: true overwrite: true
file_glob: true file_glob: true
- name: Upload win-arm64 build to asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./scripts/pkg-executable/dist/Noco-win-arm64
asset_name: Noco-win-arm64
asset_content_type: application/octet-stream
- name: Upload win-x64 build to asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./scripts/pkg-executable/dist/Noco-win-x64
asset_name: Noco-win-x64
asset_content_type: application/octet-stream
- name: Upload linux-arm64 build to asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./scripts/pkg-executable/dist/Noco-linux-arm64
asset_name: Noco-linux-arm64
asset_content_type: application/octet-stream
- name: Upload linux-x64 build to asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./scripts/pkg-executable/dist/Noco-linux-x64
asset_name: Noco-linux-x64
asset_content_type: application/octet-stream
- uses: actions/upload-artifact@master - uses: actions/upload-artifact@master
with: with:
name: ${{ github.event.inputs.tag || inputs.tag }} name: ${{ github.event.inputs.tag || inputs.tag }}
@ -140,55 +197,82 @@ jobs:
with: with:
path: 'homebrew-nocodb' path: 'homebrew-nocodb'
token: ${{ secrets.NC_GITHUB_TOKEN }} token: ${{ secrets.NC_GITHUB_TOKEN }}
repository: 'nocodb/homebrew-noco' repository: 'nocodb/homebrew-nocodb'
fetch-depth: 0 fetch-depth: 0
- name: Compress files and calculate checksum - name: Compress files and calculate checksum
run: | run: |
cp ./mac-dist/Noco-macos-x64 ./mac-dist/noco cp ./mac-dist/Noco-macos-x64 ./mac-dist/nocodb
tar -czf ./mac-dist/noco.tar.gz ./mac-dist/noco tar -czf ./mac-dist/nocodb.tar.gz ./mac-dist/nocodb
rm ./mac-dist/noco rm ./mac-dist/nocodb
echo "::set-output name=CHECKSUM::$(shasum -a 256 ./mac-dist/noco.tar.gz | awk '{print $1}')" echo "::set-output name=CHECKSUM::$(shasum -a 256 ./mac-dist/nocodb.tar.gz | awk '{print $1}')"
id: compress id: compress
- name: Upload macos-x64 build to asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./scripts/pkg-executable/mac-dist/Noco-macos-x64
asset_name: Noco-macos-x64
asset_content_type: application/octet-stream
- name: Upload mac executables to release
uses: svenstaro/upload-release-action@v2
- name: Upload macos-arm64 build to asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
repo_token: ${{ secrets.NC_GITHUB_TOKEN }} upload_url: ${{ steps.get_release.outputs.upload_url }}
file: scripts/pkg-executable/mac-dist/** asset_path: ./scripts/pkg-executable/mac-dist/Noco-macos-arm64
tag: ${{ github.event.inputs.tag || inputs.tag }} asset_name: Noco-macos-arm64
overwrite: true asset_content_type: application/octet-stream
file_glob: true
- name: Upload macos compressed build to asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./scripts/pkg-executable/mac-dist/nocodb.tar.gz
asset_name: Noco-macos-arm64
asset_content_type: application/octet-stream
- name: Generate Homebrew Formula class and push - name: Generate Homebrew Formula class and push
run: | run: |
FORMULA_CLASS_STR=$(cat << EOF FORMULA_CLASS_STR=$(cat << EOF
class Noco < Formula class Nocodb < Formula
desc "Get Human Readable file size information. - CLI" desc "Get Human Readable file size information. - CLI"
homepage "https://github.com/nocodb/nocodb" homepage "https://github.com/nocodb/nocodb"
url "https://github.com/novcodb/nocodb/releases/download/${{ github.event.inputs.tag || inputs.tag }}/noco.tar.gz" url "https://github.com/nocodb/nocodb/releases/download/${{ github.event.inputs.tag || inputs.tag }}/nocodb.tar.gz"
sha256 "${{ steps.compress.outputs.CHECKSUM }}" sha256 "${{ steps.compress.outputs.CHECKSUM }}"
license "MIT" license "MIT"
version "${{ github.event.inputs.tag || inputs.tag }}" version "${{ github.event.inputs.tag || inputs.tag }}"
def install def install
bin.install "noco" bin.install "nocodb"
end end
end end
EOF EOF
) )
printf "$FORMULA_CLASS_STR" > homebrew-nocodb/Formula/noco.rb
cd ./homebrew-nocodb cd ./homebrew-nocodb
printf "$FORMULA_CLASS_STR" > ./Formula/nocodb.rb
git config user.name 'github-actions[bot]' git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com' git config user.email 'github-actions[bot]@users.noreply.github.com'
git commit ./Formula/noco.rb -m "Automatic publish" git commit ./Formula/nocodb.rb -m "Automatic publish"
git push git push

Loading…
Cancel
Save