From 5d9cece992bf3d3100f65da0f6922fd911187500 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 5 May 2021 13:35:13 +0200 Subject: ci: Add workflow for releases This change adds a new Github Actions workflow that is triggered when a new tag is pushed. This workflow will automatically build the project and create a new Github release. --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/release.yml (limited to '.github/workflows') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..59dc346a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + push: + tags: ['v*'] + +jobs: + build: + name: Build OpenDC + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 15 ] + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@v1 + - name: Set up JDK + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Grant execute permission for gradlew + run: chmod +x gradlew + - uses: actions/cache@v1 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle*') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.java }}-gradle- + - name: Build with Gradle + run: ./gradlew :assembleDist + - name: Release + uses: softprops/action-gh-release@v1 + with: + prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-m') }} + files: build/distributions/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -- cgit v1.2.3 From 50aa13c5e9943275bca3132e83b49e59f997084a Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 5 May 2021 15:24:15 +0200 Subject: ci: Add workflow for publishing Docker images This change adds a new Github Actions workflow that publishes the Docker images on publication of a new Github release. --- .github/workflows/publish.yml | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/publish.yml (limited to '.github/workflows') diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..4c74bb36 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,48 @@ +name: Publish Docker image + +on: + release: + types: [published] + +jobs: + push-simulator: + name: Push Simulator + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Push to Docker Hub + uses: docker/build-push-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: atlargeresearch/opendc + tag_with_ref: true + push-api: + name: Push API + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Push to Docker Hub + uses: docker/build-push-action@v1 + with: + context: opendc-web/opendc-web-api + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: atlargeresearch/opendc-web-api + tag_with_ref: true + push-ui: + name: Push UI + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Push to Docker Hub + uses: docker/build-push-action@v1 + with: + context: opendc-web/opendc-web-ui + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: atlargeresearch/opendc-web-ui + tag_with_ref: true -- cgit v1.2.3 From d4eb8ccd4f5d93d9e858b9c3ed6ff48763e68820 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 6 May 2021 13:37:51 +0200 Subject: ci: Add workflow step for publishing release to Maven Central This change adds a workflow step that publishes the release to Maven Central using Gradle. --- .github/workflows/release.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 59dc346a..d9cd6c97 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,7 +30,15 @@ jobs: ${{ runner.os }}-${{ matrix.java }}-gradle- - name: Build with Gradle run: ./gradlew :assembleDist - - name: Release + - name: Publish with Gradle + run: ./gradlew publish + env: + ORG_GRADLE_PROJECT_signingKeyId: F8134F9C + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }} + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PASSPHRASE }} + ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }} + ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }} + - name: Create Release uses: softprops/action-gh-release@v1 with: prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-m') }} -- cgit v1.2.3