Skip to content

Commit ab2483a

Browse files
Added Github Action for release compas-sct (#53)
* Added releasing action & changed copyright to RTE FRANCE Added releasing action & changed copyright to RTE FRANCE Signed-off-by: Samir Romdhani <[email protected]> * Updated automate projects action Signed-off-by: Samir Romdhani <[email protected]>
1 parent 78853d1 commit ab2483a

File tree

5 files changed

+56
-5
lines changed

5 files changed

+56
-5
lines changed

.github/workflows/automate_projects.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
name: Add issues and pull request to project boards
66

7-
on: [ issues, pull_request ]
7+
on: [ issues, pull_request, pull_request_target ]
88

99
jobs:
1010
github-actions-automate-projects:
1111
runs-on: ubuntu-latest
12+
13+
if: ${{ (github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') }}
1214
steps:
1315
- name: add-new-issues-to-repository-based-project-column
1416
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
@@ -19,7 +21,7 @@ jobs:
1921
GITHUB_PROJECT_COLUMN_NAME: To do
2022
- name: add-new-pull-request-to-repository-based-project-column
2123
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
22-
if: github.event_name == 'pull_request' && github.event.action == 'opened'
24+
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened'
2325
env:
2426
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2527
GITHUB_PROJECT_URL: https://github.com/com-pas/compas-sct/projects/1
@@ -33,7 +35,7 @@ jobs:
3335
GITHUB_PROJECT_COLUMN_NAME: To do
3436
- name: add-new-pull-request-to-organization-based-project-column
3537
uses: docker://takanabe/github-actions-automate-projects:v0.0.1
36-
if: github.event_name == 'pull_request' && github.event.action == 'opened'
38+
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'opened'
3739
env:
3840
GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_ACTION_SECRET }}
3941
GITHUB_PROJECT_URL: https://github.com/orgs/com-pas/projects/2
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# SPDX-FileCopyrightText: 2022 RTE FRANCE
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: Release Project
6+
7+
on:
8+
release:
9+
types: [ released ]
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Extract tag name
20+
id: extract_tagname
21+
shell: bash
22+
# Extra the tagname form the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
23+
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"
24+
- name: Set up JDK 1.11
25+
uses: actions/[email protected]
26+
with:
27+
distribution: 'zulu'
28+
java-version: '11'
29+
- name: Create custom Maven Settings.xml
30+
uses: whelk-io/maven-settings-xml-action@v20
31+
with:
32+
output_file: custom_maven_settings.xml
33+
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
34+
- name: Set version with Maven
35+
run: mvn -B versions:set -DprocessAllModules=true -DnewVersion=${{ steps.extract_tagname.outputs.tagname }}
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
- name: Deploy with Maven to GitHub Packages
39+
run: mvn --batch-mode -s custom_maven_settings.xml clean deploy
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/reuse.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2021 Alliander N.V.
1+
# SPDX-FileCopyrightText: 2022 RTE FRANCE
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

.github/workflows/sonarcloud-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2020 Alliander N.V.
1+
# SPDX-FileCopyrightText: 2022 RTE FRANCE
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
<packaging>pom</packaging>
1313
<name>COMPAS-SCT</name>
1414

15+
<distributionManagement>
16+
<repository>
17+
<id>github-packages-compas</id>
18+
<name>GitHub Packages</name>
19+
<url>https://maven.pkg.github.com/com-pas/compas-sct</url>
20+
</repository>
21+
</distributionManagement>
22+
1523
<repositories>
1624
<repository>
1725
<id>github-packages-compas</id>

0 commit comments

Comments
 (0)