-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TCN-463 rebuild CI in GitHub actions (#640)
Signed-off-by: Elliot Jackson <elliot@buf.build>
- Loading branch information
Elliot Jackson
committed
Sep 26, 2022
1 parent
2eca307
commit 5af2b1d
Showing
6 changed files
with
120 additions
and
62 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: ci | ||
|
||
on: | ||
pull_request: | ||
|
||
env: | ||
TEST_TAG: protoc-gen-validate:${{ github.sha }} | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Build and export to Docker | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
load: true | ||
push: false | ||
tags: ${{ env.TEST_TAG }} | ||
- name: Run | ||
run: | | ||
docker run --rm ${{ env.TEST_TAG }} ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created | ||
## For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path | ||
|
||
name: Maven Package | ||
|
||
on: | ||
pull_request: | ||
release: | ||
types: [ created ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: "17" | ||
distribution: "temurin" | ||
|
||
- name: Verify with Maven | ||
working-directory: ${{ github.workspace }}/java | ||
run: mvn -B verify | ||
|
||
deploy: | ||
if: github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
env: | ||
SONATYPE_USER: ${{secrets.SONATYPE_USER}} | ||
SONATYPE_PASSWORD: ${{secrets.SONATYPE_PASSWORD}} | ||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
GPG_KEY_NAME: ${{secrets.GPG_KEY_NAME}} | ||
GPG_PASSPHRASE: ${{secrets.GPG_PASSPHRASE}} | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: "17" | ||
distribution: "temurin" | ||
server-id: sonatype-nexus-snapshots | ||
server-username: ${{ env.SONATYPE_USER }} | ||
server-password: ${{ env.SONATYPE_PASSWORD }} | ||
gpg-private-key: ${{ env.GPG_PRIVATE_KEY }} | ||
gpg-passphrase: ${{ env.GPG_PASSPHRASE }} | ||
|
||
- name: Configure Git User | ||
run: | | ||
git config --global user.email "envoy-bot@users.noreply.github.com" | ||
git config --global user.name "envoy-bot" | ||
- name: Publish to Apache Maven Central | ||
working-directory: ${{ github.workspace }}/java | ||
run: mvn release:prepare | ||
env: | ||
MAVEN_USERNAME: ${{ env.SONATYPE_USER }} | ||
MAVEN_CENTRAL_TOKEN: ${{ env.SONATYPE_PASSWORD }} | ||
MAVEN_GPG_PASSPHRASE: ${{ env.GPG_PASSPHRASE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Release Python Package | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
environment: production | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v3 | ||
run: | | ||
docker run --rm \ | ||
--env PYPI_REPO=pypi \ | ||
--env PGV_PYPI_TOKEN="${{secrets.PGV_PYPI_TOKEN}}" \ | ||
protoc-gen-validate python-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters