-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
264 additions
and
180 deletions.
There are no files selected for viewing
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,96 @@ | ||
name: Release WIP | ||
|
||
on: | ||
push: | ||
branches: | ||
- joao/ci-overhaul | ||
workflow_dispatch: | ||
|
||
jobs: | ||
permission_check: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
can-write: ${{ steps.check.outputs.can-write }} | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
steps: | ||
- id: check | ||
run: | | ||
# If the AWS_ACCESS_KEY_ID secret is MIA we can't run tests | ||
if [[ -z "$AWS_ACCESS_KEY_ID" ]]; then | ||
echo "can-write=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "can-write=true" >> $GITHUB_OUTPUT | ||
fi | ||
tests: | ||
needs: permission_check | ||
uses: ./.github/workflows/tests-integration.yaml | ||
if: needs.permission_check.outputs.can-write == 'true' | ||
secrets: inherit | ||
|
||
fetch-regions: | ||
runs-on: ubuntu-latest | ||
needs: permission_check | ||
if: needs.permission_check.outputs.can-write == 'true' | ||
permissions: | ||
id-token: write | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- name: Setup AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4.0.2 | ||
with: | ||
role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | ||
aws-region: us-west-2 | ||
|
||
- name: AWS Info | ||
run: aws sts get-caller-identity | ||
|
||
- name: Fetch available AWS regions | ||
id: fetch-regions | ||
run: | | ||
regions=$(aws ec2 describe-regions --query "Regions[].RegionName" --output text | tr '\t' '\n' | jq -R -s -c 'split("\n")[:-1]') | ||
echo "Regions: $regions" | ||
echo "regions_json=$regions" >> "$GITHUB_ENV" | ||
- name: Set Matrix for aws-release job | ||
id: set-matrix | ||
run: echo "matrix=${regions_json}" >> "$GITHUB_OUTPUT" | ||
|
||
github-release: | ||
needs: [tests, permission_check] | ||
runs-on: ubuntu-latest | ||
if: > | ||
(needs.permission_check.outputs.can-write == 'true' && github.event_name == 'push') || | ||
(github.event_name == 'workflow_dispatch' && needs.tests.result == 'success') | ||
outputs: | ||
version: ${{ steps.release-version.outputs.VERSION }} | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: github release (beta) | ||
if: github.event_name == 'push' | ||
id: prerelease | ||
uses: ahmadnassri/action-semantic-release@v2 | ||
with: | ||
config: ${{ github.workspace }}/.releaserc.json | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: github release (stable) | ||
if: github.event_name == 'workflow_dispatch' | ||
id: fullrelease | ||
uses: ahmadnassri/action-semantic-release@v2 | ||
with: | ||
config: ${{ github.workspace }}/.releaserc-release.json | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set version for aws-release job | ||
id: release-version | ||
run: | | ||
echo "VERSION=${{ env.VERSION }}" >> "$GITHUB_OUTPUT" | ||
env: | ||
VERSION: ${{ (steps.prerelease.outputs.release-version != '') && steps.prerelease.outputs.release-version || steps.fullrelease.outputs.release-version }} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.