Skip to content

Commit d16ba65

Browse files
committed
Add publishing workflow
1 parent 4f6bfb8 commit d16ba65

File tree

7 files changed

+77
-1
lines changed

7 files changed

+77
-1
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
workflow_dispatch:
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
environment: release
14+
15+
permissions:
16+
packages: write
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Run Build
22+
run: ./amper build
23+
24+
- name: Run Tests
25+
run: ./amper test
26+
27+
- name: Set version number
28+
run: echo "settings:\n publishing:\n version:1.0.$GITHUB_RUN_NUMBER" > version-number.module-template.yaml
29+
env:
30+
GITHUB_RUN_NUMBER: ${{github.run_number}}
31+
32+
- name: Set up credentials
33+
run: |
34+
echo "github.username=$REPO_OWNER" > local.properties
35+
echo "github.password=$GITHUB_TOKEN" >> local.properties
36+
env:
37+
REPO_OWNER: ${{ github.repository_owner }}
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
40+
- name: Publish
41+
run: ./amper publish github

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
/build
1+
/build
2+
local.properties
3+

app/module.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@ product: jvm/app
33
dependencies:
44
- ../lib
55
- "com.github.ajalt.clikt:clikt:5.0.3"
6+
7+
settings:
8+
publishing:
9+
name: opml-tool
10+
11+
apply:
12+
- ../publish.module-template.yaml

lib/module.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ dependencies:
1212
settings:
1313
kotlin:
1414
serialization: enabled
15+
publishing:
16+
name: kotlin-opml
17+
18+
apply:
19+
- ../publish.module-template.yaml

local.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.username=
2+
github.password=

publish.module-template.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
repositories:
2+
- id: github
3+
url: https://maven.pkg.github.com/janseeger/kotlin-opml
4+
resolve: false
5+
publish: true
6+
credentials:
7+
file: local.properties
8+
usernameKey: github.username
9+
passwordKey: github.password
10+
11+
settings:
12+
publishing:
13+
group: net.alphadev
14+
15+
apply:
16+
- version-number.module-template.yaml
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
settings:
2+
publishing:
3+
version:0.0.0

0 commit comments

Comments
 (0)