Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore automated wiki updates #1282

Merged
merged 1 commit into from
Mar 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/wiki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Push to the GitHub Wiki

on:
push:
branches:
- master
paths:
- "docs/**"
workflow_dispatch:

permissions:
contents: write

jobs:
push-to-wiki:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
path: job-dsl-plugin
- name: Checkout wiki
uses: actions/checkout@v3
with:
repository: ${{github.repository}}.wiki
path: job-dsl-plugin.wiki
- name: Push to wiki
run: |
git config --global user.email "actions@users.noreply.github.com"
git config --global user.name "wiki[bot]"

pushd job-dsl-plugin
./build-wiki.sh
popd

pushd job-dsl-plugin.wiki
cp -r ../job-dsl-plugin/target/docs/* .
git add .
git commit -m "Automagic update"
git push
popd
1 change: 1 addition & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ These are the steps to release the Maven-based Job DSL plugin.
* Set `compatibleSinceVersion` to the new version if deprecated features have been removed
* Prepare and perform the release: `mvn release:prepare release:perform`
* Edit the [draft release notes](https://github.com/jenkinsci/job-dsl-plugin/releases) and publish them
* Run the [Push to the GitHub Wiki](https://github.com/jenkinsci/job-dsl-plugin/actions/workflows/wiki.yml) workflow to update the wiki with the new version
* File a pull request to add the newly-released version to the API viewer in `job-dsl-plugin/pom.xml` and `job-dsl-plugin/src/main/hbs/root.hbs`
* Close all resolved issues in [JIRA](https://issues.jenkins-ci.org/secure/Dashboard.jspa?selectPageId=15341)
* Open a pull request to update the [Job DSL Playground](https://github.com/sheehan/job-dsl-playground)
Expand Down
15 changes: 15 additions & 0 deletions build-wiki.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh -eux

mkdir -p target/docs

mvn -B -e -ntp -q -Dexpression=jenkins.version -Doutput=jenkins.version help:evaluate
JENKINS_VERSION=`cat jenkins.version`

curl -sSO https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/job-dsl/maven-metadata.xml
VERSION=$(grep '<latest>.*</latest>' maven-metadata.xml | cut -d'>' -f2 | cut -d'<' -f1)

cp -r docs target
sed -i -e "s/@jenkinsVersion@/${JENKINS_VERSION}/g" target/docs/*.md
sed -i -e "s/@version@/${VERSION}/g" target/docs/*.md

exit 0
4 changes: 3 additions & 1 deletion job-dsl-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@
</developers>
<distributionManagement>
<site>
<id>github</id>
<id>github.com</id>
<url>scm:git:git@github.com:${gitHubUser}/job-dsl-plugin.git</url>
</site>
</distributionManagement>
<properties>
<gitHubUser>jenkinsci</gitHubUser>
<!-- TODO GMavenPlus does not support Javadoc -->
<maven.javadoc.skip>true</maven.javadoc.skip>
<node.version>18.14.2</node.version>
Expand Down Expand Up @@ -476,6 +477,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<checkinComment>updated gh-pages for ${project.version}</checkinComment>
<scmBranch>gh-pages</scmBranch>
Expand Down
21 changes: 0 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,9 @@
<tag>${scmTag}</tag>
<url>https://github.com/${gitHubRepo}</url>
</scm>
<distributionManagement>
<site>
<id>github</id>
<url>scm:git:git@github.com:${gitHubUser}/job-dsl-plugin.wiki.git</url>
</site>
</distributionManagement>
<properties>
<revision>1.82</revision>
<changelist>-SNAPSHOT</changelist>
<gitHubUser>jenkinsci</gitHubUser>
<gitHubRepo>jenkinsci/job-dsl-plugin</gitHubRepo>
<jenkins.version>2.361.4</jenkins.version>
<!-- TODO fix violations -->
Expand Down Expand Up @@ -101,11 +94,6 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
<version>3.1.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand All @@ -117,15 +105,6 @@
<tagNameFormat>job-dsl-@{project.version}</tagNameFormat>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
<configuration>
<checkinComment>updated wiki for ${project.version}</checkinComment>
<scmBranch>master</scmBranch>
<!-- TODO generate the wiki from docs/*.md replacing version with project.version and jenkinsVersion with jenkins.version -->
</configuration>
</plugin>
</plugins>
</build>
</project>