Skip to content

Commit

Permalink
Setup CI
Browse files Browse the repository at this point in the history
  • Loading branch information
kuviman committed Nov 27, 2021
1 parent 7d8071a commit 364ee08
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI
on:
push:
pull_request:
workflow_dispatch:

env:
JDK_JAVA_OPTIONS: "--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: 17
distribution: "adopt"
- name: Test
run: |
cd code
mvn --batch-mode test
deploy:
if: github.ref == 'refs/heads/master' && github.repository_owner == 'Codeforces'
needs: test
runs-on: windows-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
java-version: "17"
distribution: "adopt"
- name: Deploy
run: |
cd code
mvn --batch-mode deploy -DskipTests
8 changes: 8 additions & 0 deletions code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
<url>https://github.com/Codeforces/geoip</url>
<description>geoip for Codeforces and related projects.</description>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/Codeforces/geoip</url>
</repository>
</distributionManagement>

<licenses>
<license>
<name>The MIT License (MIT)</name>
Expand Down

0 comments on commit 364ee08

Please sign in to comment.