Skip to content

Commit

Permalink
chore: automatically publish new versions
Browse files Browse the repository at this point in the history
  • Loading branch information
vlsi committed Nov 15, 2023
1 parent 82c2fef commit 2c794cc
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 40 deletions.
39 changes: 39 additions & 0 deletions .github/actions/publish-update-site/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish update site
description: Publishes the updated update-site
inputs:
update_site_token:
required: true
description: GitHub token for publishing
runs:
using: "composite"
steps:
- name: Checkout update site
uses: actions/checkout@v4
with:
repository: vlsi/mat-calcite-plugin-update-site
path: MatCalciteRepository/target/mat-calcite-plugin-update-site
token: ${{ inputs.update_site_token }}
- name: Publish
shell: bash
run: |
PLUGIN_VERSION=$(./mvnw help:evaluate -q -DforceStdout -D"expression=project.version")
cd MatCalciteRepository/target
# git clone https://github.com/vlsi/mat-calcite-plugin-update-site.git
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
if [ -z ${i##*-SNAPSHOT} ]; then
REPO=ea
else
REPO=stable
fi
DIR=mat-calcite-plugin-update-site/$REPO
rm -rf $DIR
# Copy "repository" recursively as "ea" or "stable" folder
cp -R repository $DIR
cd mat-calcite-plugin-update-site
# Restore the deleted readme, so the browser can display it
git checkout $REPO/README.md
git add -A
git commit -m "Update site for ${PLUGIN_VERSION}, ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}"
git push
19 changes: 17 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache local Maven repository
uses: actions/cache@v3
with:
Expand All @@ -41,4 +41,19 @@ jobs:
- name: Test
run: |
./mvnw --color=always -B verify
- uses: actions/upload-artifact@v3
name: Attach generated update site as zip
if: matrix.os == 'ubuntu-latest'
with:
name: mat-calcite-plugin-update-site
# actions/upload-artifact always creates .zip, so we specify directory here to prevent double zip archiving
path: MatCalciteRepository/target/repository/*
# Default retention is 90 days, and we publish the archives to the update site anyway
retention-days: 4
- name: Publish Eclipse update site
if: matrix.os == 'ubuntu-latest' && github.repository == 'vlsi/mat-calcite-plugin'
#&& github.ref == 'refs/heads/main'
uses: ./.github/actions/publish-update-site
with:
update_site_token:
${{ secrets.UPDATE_SITE_TOKEN }}
82 changes: 49 additions & 33 deletions MatCalciteTargetPlatform/MatCalciteTargetPlatform.target
Original file line number Diff line number Diff line change
@@ -1,36 +1,52 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.5"?>

<target name="eclipse 4.5.0" includeMode="feature">
<locations>
<location includeDependencyDepth="infinite" includeDependencyScopes="compile,provided,runtime" includeSource="true" label="Maven Central" missingManifest="generate" type="Maven">
<dependencies>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>accessors-smart</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-core</artifactId>
<version>1.36.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.1.3-jre</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
</dependencies>
</location>
</locations>
<target includeMode="feature" name="eclipse 4.5.0">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="false" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/2022-12"/>
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
<unit id="org.eclipse.equinox.p2.user.ui.feature.group" version="0.0.0"/>
<unit id="org.eclipse.rcp.feature.group" version="0.0.0"/>
</location>
<location includeDependencyDepth="infinite" includeDependencyScopes="compile,provided,runtime" includeSource="true" label="Maven Central" missingManifest="generate" type="Maven">
<dependencies>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>accessors-smart</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-core</artifactId>
<version>1.36.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.1.3-jre</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
</dependency>
</dependencies>
<instructions><![CDATA[
-reproducible: true
-noextraheaders: true
Bundle-Name: Bundle derived from maven artifact ${mvnGroupId}:${mvnArtifactId}:${mvnVersion}
version: ${version_cleanup;${mvnVersion}}
Bundle-SymbolicName: wrapped.${mvnGroupId}.${mvnArtifactId}
Bundle-Version: ${version}
Import-Package: *;resolution:=optional
Export-Package: *;version="${version}";-noimport:=true
DynamicImport-Package: *
]]></instructions>
</location>
</locations>
</target>
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ See [Calcite SQL reference](https://calcite.apache.org/docs/reference.html)
Installation
------------

Requirements: Java 1.8+, Eclipse Memory Analyzer 1.8.0+
Requirements: Java 17+, Eclipse Memory Analyzer 0.14.0+

TL;DR: use the following update repository to install the latest released version: https://dl.bintray.com/vlsi/eclipse/updates/
There are two update channels:
* https://vlsi.github.io/mat-calcite-plugin-update-site/stable (stable releases)
* https://vlsi.github.io/mat-calcite-plugin-update-site/ea (early access, per-commit releases)

To install Calcite SQL plugin, perform the following:
1. Open `Help`, `Install New Software...`
1. Click `Add`, it will open a `Add Repository` window
1. Type `Calcite SQL plugin site` to the `Name` field
1. Type `https://dl.bintray.com/vlsi/eclipse/updates/` to the `Location` field
1. Type `Calcite SQL plugin stable releases` to the `Name` field
1. Type `https://vlsi.github.io/mat-calcite-plugin-update-site/stable/` to the `Location` field
1. Click `Ok`
1. All the checkboxes can be left by default (`Show only latest version`, `Group items by category`, ...)
1. Check `SQL for Memory Analyzer` category
Expand All @@ -36,7 +38,7 @@ To install Calcite SQL plugin, perform the following:
Early access versions
---------------------

Development builds are pushed to https://dl.bintray.com/vlsi/eclipse-test/updates/ repository,
Development builds are pushed to https://vlsi.github.io/mat-calcite-plugin-update-site/ea/ repository,
so you can preview the upcoming version right after the commit lands to the default branch.

Sample
Expand Down

0 comments on commit 2c794cc

Please sign in to comment.