Release #22
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
name: Release | |
on: | |
workflow_run: | |
workflows: [ "Vulnerability Scan with MobSF", "Security and Code-Quality scan with CodeQL - Package", "Security and Code-Quality scan with CodeQL - Quickstart Sample", "Code-Quality scan with SwiftLint" ] | |
types: [ completed ] | |
branches: [ main ] | |
# Triggers the workflow on push events but only for default and protected branches | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
repository-projects: read | |
# only required for workflows in private repositories | |
actions: read | |
security-events: write | |
# required to fetch internal or private CodeQL packs | |
packages: read | |
concurrency: | |
group: release | |
jobs: | |
# This job runs a simple E2E test with the latest FusionAuth and iOS version as a prerequisite for the prerelease-prep | |
initial-e2e-test: | |
name: Run Prerelease E2E Tests | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
uses: ./.github/workflows/e2e-test-fusionauth-latest-ios-latest.yml | |
# This job creates or finalizes a prerelease pull request and provides the necessary outputs for the subsequent jobs | |
prerelease-prep: | |
name: Create Prerelease Pull Request | |
runs-on: ubuntu-latest | |
needs: [ initial-e2e-test ] | |
outputs: | |
releases_created: ${{ steps.release.outputs.releases_created }} | |
tag_name: ${{ steps.release.outputs.tag_name }} | |
steps: | |
- id: release | |
name: Run prerelease release-please | |
uses: googleapis/[email protected] | |
with: | |
config-file: ".github/prerelease-config.json" | |
manifest-file: ".github/prerelease-manifest.json" | |
# This job runs the E2E tests with FusionAuth Matrix as a prerequisite for the prerelease job | |
prerelease-e2e-test-fusionauth-matrix: | |
name: Run Prerelease E2E Tests with FusionAuth Matrix | |
if: ${{ needs.prerelease-prep.outputs.releases_created == 'true' && contains(needs.prerelease-prep.outputs.tag_name, 'rc') }} | |
needs: prerelease-prep | |
uses: ./.github/workflows/e2e-test-fusionauth-matrix-ios-latest.yml | |
# This job runs the E2E tests with iOS Matrix as a prerequisite for the prerelease job | |
prerelease-e2e-test-ios-matrix: | |
name: Run Prerelease E2E Tests with iOS Matrix | |
if: ${{ needs.prerelease-prep.outputs.releases_created == 'true' && contains(needs.prerelease-prep.outputs.tag_name, 'rc') }} | |
needs: prerelease-prep | |
uses: ./.github/workflows/e2e-test-fusionauth-latest-ios-matrix.yml | |
# This job runs creates the Prerelease and creates a subsequent Release Pull Request | |
prerelease: | |
name: Create Prerelease and Release Pull Request | |
runs-on: ubuntu-latest | |
if: ${{ needs.prerelease-prep.outputs.releases_created == 'true' && contains(needs.prerelease-prep.outputs.tag_name, 'rc') }} | |
needs: [ prerelease-prep, prerelease-e2e-test-fusionauth-matrix, prerelease-e2e-test-ios-matrix ] | |
steps: | |
- name: Pre Release Step | |
run: | | |
echo "Running pre-release step!" | |
- name: Run release release-please | |
uses: googleapis/[email protected] | |
with: | |
config-file: ".github/release-config.json" | |
manifest-file: ".github/release-manifest.json" | |
# This job creates the final release and Syncs the prerelease manifest | |
release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
if: ${{ needs.prerelease-prep.outputs.releases_created == 'true' && !contains(needs.prerelease-prep.outputs.tag_name, 'rc') }} | |
needs: prerelease-prep | |
steps: | |
- name: Release Step | |
run: | | |
echo "Running release step!" | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Sync prerelease manifest | |
env: | |
MANIFEST_PATH: .github/prerelease-manifest.json | |
RELEASE_TAG: ${{ needs.prerelease-prep.outputs.tag_name }} | |
run: | | |
jq --arg tag "${RELEASE_TAG//v/}" '.["."] = $tag' $MANIFEST_PATH > temp.json \ | |
&& mv temp.json $MANIFEST_PATH | |
- name: Commit change | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add . $MANIFEST_PATH | |
git commit -m "chore: sync release manifests" | |
git push | |
# This job runs post-release steps | |
post-release: | |
name: Post Release Steps | |
runs-on: ubuntu-latest | |
needs: release | |
steps: | |
- name: Post Release Step | |
run: | | |
echo "Running post-release steps!" |