1- # Run locally with act:
2- #
3- # act pull_request [--input command=[command]] \
4- # --platform fusionauth-standard=[ecr-repo-name]/fusionauth-standard:latest] \
5- # --workflows ./.github/workflows/deploy.yaml \
6- # --env-file <(aws configure export-credentials --profile [aws-profile] --format env)
7-
1+ ---
82name : Deploy
93
104on :
2620
2721permissions :
2822 contents : read
23+ id-token : write
2924
3025jobs :
31- build :
32- if : |
33- github.event_name == 'pull_request' ||
34- github.event_name == 'push' ||
35- github.event_name == 'workflow_dispatch' && inputs.command == 'build'
36- runs-on : fusionauth-standard
26+ deploy :
27+ runs-on : ubuntu-latest
28+ defaults :
29+ run :
30+ shell : /usr/bin/bash -l -e -o pipefail {0}
3731 steps :
3832 - name : checkout
3933 uses : actions/checkout@v4
4034
35+ - name : setup java
36+ uses : actions/setup-java@v4
37+ with :
38+ distribution : temurin
39+ java-version : 21
40+ java-package : jre
41+
42+ - name : install savant
43+ run : |
44+ curl -O https://repository.savantbuild.org/org/savantbuild/savant-core/2.0.0/savant-2.0.0.tar.gz
45+ tar xzvf savant-2.0.0.tar.gz
46+ savant-2.0.0/bin/sb --version
47+ SAVANT_PATH=$(realpath -s "./savant-2.0.0/bin")
48+ echo "${SAVANT_PATH}" >> $GITHUB_PATH
49+ mkdir -p ~/.savant/plugins
50+ cat << EOF > ~/.savant/plugins/org.savantbuild.plugin.java.properties
51+ 21=${JAVA_HOME}
52+ EOF
53+
54+ # Installs the version specified in the .ruby-version file in the repo root.
55+ - name : install ruby
56+ uses : ruby/setup-ruby@v1
57+
4158 - name : compile
4259 shell : bash -l {0}
4360 run : sb compile
4461
45- deploy :
46- if : |
47- github.event_name == 'workflow_dispatch' &&
48- (inputs.command == 'release' || inputs.command == 'publish')
49- runs-on : fusionauth-standard
50- steps :
51- - name : checkout
52- uses : actions/checkout@v4
62+ # ## Everything below this line will only run on a workflow_dispatch
5363
5464 - name : set aws credentials
65+ if : inputs.command == 'release' || inputs.command == 'publish'
5566 uses : aws-actions/configure-aws-credentials@v4
5667 with :
57- role-to-assume : arn:aws:iam::752443094709:role/github-actions
68+ role-to-assume : arn:aws:iam::752443094709:role/gha-fusionauth-ruby-client
5869 role-session-name : aws-auth-action
5970 aws-region : us-west-2
6071
6172 - name : get secret
73+ if : inputs.command == 'release' || inputs.command == 'publish'
6274 run : |
6375 while IFS=$'\t' read -r key value; do
6476 echo "::add-mask::${value}"
@@ -71,17 +83,16 @@ jobs:
7183 jq -r 'to_entries[] | [.key, .value] | @tsv')
7284
7385 - name : set gem credentials
86+ if : inputs.command == 'release' || inputs.command == 'publish'
7487 run : |
7588 mkdir -p ~/.gem
7689 echo ":rubygems_api_key: ${{ env.API_KEY }}" > ~/.gem/credentials
7790 chmod 600 ~/.gem/credentials
7891
7992 - name : release to svn
8093 if : inputs.command == 'release'
81- shell : bash -l {0}
8294 run : sb release
8395
8496 - name : publish to rubygems
8597 if : inputs.command == 'publish'
86- shell : bash -l {0}
8798 run : sb publish
0 commit comments