Skip to content

Commit 9c9387e

Browse files
committed
add a dev workflow
1 parent 7ea01c7 commit 9c9387e

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Maven Developer
2+
3+
on:
4+
workflow_dispatch
5+
6+
jobs:
7+
build:
8+
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
packages: write
13+
14+
steps:
15+
- uses: actions/[email protected]
16+
with:
17+
ref: developer
18+
fetch-depth: 0
19+
- uses: actions/[email protected]
20+
with:
21+
repository: WISE-Developers/WISE_Versions
22+
path: versions
23+
ref: developer
24+
token: ${{ secrets.WISE_PAT }}
25+
- name: Set up JDK 8
26+
uses: actions/setup-java@v3
27+
with:
28+
java-version: '8'
29+
distribution: 'temurin'
30+
server-id: github
31+
32+
- name: Load values from versions
33+
id: version-numbers
34+
shell: pwsh
35+
run: |
36+
$versions = ConvertFrom-StringData (Get-Content versions/versions.properties -raw)
37+
echo "Updating to version $($versions.wise)-dev-$(date +'%Y-%m-%d')_$(date +'%H.%M')"
38+
echo "wise_version=$($versions.wise)-dev-$(date +'%Y-%m-%d')_$(date +'%H.%M')" >> $env:GITHUB_OUTPUT
39+
- name: Update the version
40+
run: mvn versions:set -DnewVersion=${{ steps.version-numbers.outputs.wise_version }}
41+
42+
- name: Build with Maven
43+
run: mvn -B package --file pom.xml
44+
45+
- name: Publish package
46+
run: mvn --batch-mode deploy
47+
env:
48+
GITHUB_TOKEN: ${{ github.token }}
49+
50+
# - name: Tag the repositories
51+
# id: last-tags
52+
# run: |
53+
# git config user.name github-actions
54+
# git config user.email [email protected]
55+
# LAST_TAG=$(git describe --abbrev=0 --tags)
56+
# echo "last_tag=$LAST_TAG" >> $GITHUB_OUTPUT
57+
# git tag -a ${{ steps.version-numbers.outputs.wise_version }} -m "Release on $(date +'%Y-%m-%d') for commit $(git rev-parse HEAD)"
58+
59+
# - name: Push changes
60+
# uses: ad-m/github-push-action@master
61+
# with:
62+
# tags: true
63+
64+
# - name: Create Release Notes
65+
# id: api-notes
66+
# uses: mikepenz/[email protected]
67+
# with:
68+
# owner: WISE-Developers
69+
# repo: WISE_Java_API
70+
# toTag: ${{ steps.version-numbers.outputs.wise_version }}
71+
# fromTag: ${{ steps.last-tags.outputs.last_tag }}
72+
# env:
73+
# GITHUB_TOKEN: ${{ secrets.WISE_PAT }}
74+
75+
- name: Create release
76+
uses: softprops/action-gh-release@v1
77+
with:
78+
name: ${{ steps.version-numbers.outputs.wise_version }}
79+
body: ${{ steps.api-notes.outputs.changelog }}
80+
prerelease: true
81+
files: target/*.jar
82+
tag_name: refs/tags/${{ steps.version-numbers.outputs.wise_version }}

0 commit comments

Comments
 (0)