-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new workflow files / update ecocode-rule-spec / update CHANGELOG
- Loading branch information
Showing
5 changed files
with
184 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Manual Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
confirmeRelease: | ||
description: 'Confirm manual release creation (by typing "true") ? ----- WARNING : check version (in pom.xml files) and release notes (in CHANGELOG.md file) before confirm' | ||
default: 'false' | ||
jobs: | ||
checks: | ||
name: Requirements | ||
if: github.event.inputs.confirmeRelease == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check user permissions | ||
uses: 74th/[email protected] | ||
with: | ||
users: dedece35,glalloue,jhertout,jules-delecour-dav,olegoaer,zippy1978 | ||
build: | ||
name: Build And Release | ||
needs: checks | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
outputs: | ||
last_tag: ${{ steps.export_last_tag.outputs.last_tag }} | ||
upload_url: ${{ steps.export_upload_url.outputs.upload_url }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Change commiter | ||
run: | | ||
git config user.name 'github-actions[bot]' | ||
git config user.email '' | ||
- name: Maven release | ||
run: mvn release:prepare -B -ff -DtagNameFormat=@{project.version} | ||
- name: Maven release clean | ||
run: mvn release:clean | ||
- name: Get last TAG | ||
run: echo "LAST_TAG=$(git tag --sort=-version:refname | head -n 1)" >> $GITHUB_ENV | ||
- name: Extract release notes | ||
id: extract-release-notes | ||
uses: ffurrer2/extract-release-notes@v1 | ||
- name: Checkout tag "${{ env.LAST_TAG }}" | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.LAST_TAG }} | ||
- name: Build project | ||
run: mvn -e -B clean package -DskipTests | ||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.LAST_TAG }} | ||
release_name: Release ${{ env.LAST_TAG }} | ||
draft: false | ||
prerelease: false | ||
body: ${{ steps.extract-release-notes.outputs.release_notes }} | ||
- name: Export plugin Jar files | ||
id: export_jar_files | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ecocode-plugins | ||
path: lib | ||
- name: Export LAST_TAG | ||
id: export_last_tag | ||
run: echo "last_tag=${{ env.LAST_TAG }}" >> $GITHUB_OUTPUT | ||
- name: Export UPLOAD_URL | ||
id: export_upload_url | ||
run: echo "upload_url=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_OUTPUT | ||
upload-java: | ||
name: Upload Java Plugin | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Import plugin JAR files | ||
id: import_jar_files | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ecocode-plugins | ||
path: lib | ||
- name: Upload Release Asset - Java Plugin | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{needs.build.outputs.upload_url}} | ||
asset_path: lib/ecocode-java-plugin-${{ needs.build.outputs.last_tag }}.jar | ||
asset_name: ecocode-java-plugin-${{ needs.build.outputs.last_tag }}.jar | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
# template source: https://github.com/bretfisher/docker-build-workflow/blob/main/templates/call-docker-build.yaml | ||
name: Docker Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '*' | ||
# pull_request: | ||
# branches: | ||
# - main | ||
|
||
env: | ||
# github.repository as <account>/<repo> | ||
# IMAGE_NAME: sonarqube-ecocode | ||
# IMAGES: | | ||
# ghcr.io/${{ github.repository_owner }}/sonarqube-ecocode | ||
IMAGE_NAME: sonarqube-ecocode-java | ||
IMAGES: | | ||
ghcr.io/${{ github.repository_owner }}/sonarqube-ecocode-java | ||
jobs: | ||
Build: | ||
runs-on: ubuntu-latest | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository | ||
permissions: | ||
contents: read | ||
packages: write | ||
# This is used to complete the identity challenge | ||
# with sigstore/fulcio when running outside of PRs. | ||
id-token: write | ||
|
||
steps: | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
images: ${{ env.IMAGES }} | ||
flavor: | | ||
latest=auto | ||
tags: | | ||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | ||
type=semver,event=tag,pattern={{version}} | ||
type=semver,event=tag,pattern={{major}}.{{minor}} | ||
type=semver,event=tag,pattern={{major}} | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=sha | ||
- name: Publish image | ||
id: push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
pull: true | ||
cache-to: type=gha,mode=max | ||
cache-from: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# IDEAS | ||
|
||
.. to tranform into issues ? | ||
|
||
- [IN PROGRESS] check `pom.xml` dependencies (usefulness, scope, versions) | ||
- [DONE] first clean, check scopes, factorization | ||
- check usefulness | ||
- upgrade versions | ||
- enable github `dependabot` to create automatically PR with version upgrades of dependencides (when all dependencies will be ok) | ||
- ménage dans les branches de dev (local et remote) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters