Skip to content

Commit 2d8d98c

Browse files
committed
2 parents f9345a4 + f25b52d commit 2d8d98c

1 file changed

Lines changed: 31 additions & 4 deletions

File tree

.github/workflows/main.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,47 @@
11
name: Build plugin release
22
on:
33
push:
4-
branches: ["release"]
4+
# Sequence of patterns matched against refs/tags
5+
tags:
6+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
57

68
jobs:
79
build:
810
runs-on: ubuntu-latest
911
permissions:
1012
contents: write
1113
steps:
12-
- uses: actions/checkout@v4
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
1317
- name: Set up JDK 22
1418
uses: actions/setup-java@v4
1519
with:
1620
java-version: '22'
1721
distribution: 'zulu'
1822
cache: maven
19-
- name: Build Application
20-
run: mvn install ./authorizer
23+
- name: Build Plugin
24+
run: |
25+
mvn install --file ./authorizer/pom.xml
26+
27+
- name: Create Release
28+
id: create_release
29+
uses: actions/create-release@v1
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
tag_name: ${{ github.ref }}
34+
release_name: Release ${{ github.ref }}
35+
draft: false
36+
prerelease: false
37+
38+
- name: Upload Plugin Release
39+
id: upload-plugin-release
40+
uses: actions/upload-release-asset@v1
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
45+
asset_path: ./authorizer/target/opa-authorizer.nar
46+
asset_name: opa-authorizer.nar
47+
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)