|
1 | | -# Release to Savant or publish to Maven. |
2 | | -# Only runs via manual workflow dispatch. |
3 | | - |
4 | | -# Run locally with act: |
5 | | -# |
6 | | -# act pull_request [--input command=[command]] \ |
7 | | -# --platform fusionauth-standard=[ecr-repo-name]/fusionauth-standard:latest] \ |
8 | | -# --workflows ./.github/workflows/deploy.yaml \ |
9 | | -# --env-file <(aws configure export-credentials --profile [aws-profile] --format env) |
10 | | - |
| 1 | +--- |
11 | 2 | name: Deploy |
12 | 3 |
|
13 | 4 | on: |
|
21 | 12 |
|
22 | 13 | permissions: |
23 | 14 | contents: read |
| 15 | + id-token: write |
24 | 16 |
|
25 | 17 | jobs: |
26 | 18 | deploy: |
27 | | - if: | |
28 | | - github.event_name == 'workflow_dispatch' && |
29 | | - (inputs.command == 'release' || inputs.command == 'publish') |
30 | | - runs-on: fusionauth-standard |
| 19 | + runs-on: ubuntu-latest |
| 20 | + defaults: |
| 21 | + run: |
| 22 | + shell: /usr/bin/bash -l -e -o pipefail {0} |
31 | 23 | steps: |
32 | 24 | - name: checkout |
33 | 25 | uses: actions/checkout@v4 |
34 | 26 |
|
| 27 | + - name: setup java |
| 28 | + uses: actions/setup-java@v4 |
| 29 | + with: |
| 30 | + distribution: temurin |
| 31 | + java-version: 21 |
| 32 | + java-package: jre |
| 33 | + |
| 34 | + - name: install savant |
| 35 | + run: | |
| 36 | + curl -O https://repository.savantbuild.org/org/savantbuild/savant-core/2.0.0/savant-2.0.0.tar.gz |
| 37 | + tar xzvf savant-2.0.0.tar.gz |
| 38 | + savant-2.0.0/bin/sb --version |
| 39 | + SAVANT_PATH=$(realpath -s "./savant-2.0.0/bin") |
| 40 | + echo "${SAVANT_PATH}" >> $GITHUB_PATH |
| 41 | + mkdir -p ~/.savant/plugins |
| 42 | + cat << EOF > ~/.savant/plugins/org.savantbuild.plugin.java.properties |
| 43 | + 21=${JAVA_HOME} |
| 44 | + EOF |
| 45 | +
|
35 | 46 | - name: set aws credentials |
36 | 47 | uses: aws-actions/configure-aws-credentials@v4 |
37 | 48 | with: |
38 | | - role-to-assume: arn:aws:iam::752443094709:role/github-actions |
| 49 | + role-to-assume: arn:aws:iam::752443094709:role/gha-fusionauth-php-client |
39 | 50 | role-session-name: aws-auth-action |
40 | 51 | aws-region: us-west-2 |
41 | 52 |
|
|
58 | 69 |
|
59 | 70 | - name: release to svn |
60 | 71 | if: inputs.command == 'release' |
61 | | - shell: bash -l {0} |
62 | 72 | run: sb release |
63 | 73 |
|
64 | 74 | - name: publish to packagist |
65 | 75 | if: inputs.command == 'publish' |
66 | | - shell: bash -l {0} |
67 | 76 | run: sb publish |
0 commit comments