Skip to content

Commit

Permalink
chore: restored ci/cd pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Villa committed Jan 26, 2024
1 parent 2cb0e03 commit 70c1473
Showing 1 changed file with 117 additions and 14 deletions.
131 changes: 117 additions & 14 deletions .github/workflows/desktop-app-cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: Leapp-win
path: packages/desktop-app/release/
name: Leapp-${{ needs.tag-validation.outputs.tag-version-without-v }}-win.zip
path: packages/desktop-app/release/Leapp-${{ needs.tag-validation.outputs.tag-version-without-v }}-win.zip

build-linux:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -168,11 +168,19 @@ jobs:
zip "./release/Leapp-deb.zip" "./release/Leapp_${TAG_VERSION}_amd64.deb"
zip "./release/Leapp-appImage.zip" "./release/Leapp-${TAG_VERSION}.AppImage"
- name: Upload artifacts
uses: actions/upload-artifact@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
name: Leapp-linux
path: packages/desktop-app/release/
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Release draft to S3
run: |
cd packages/desktop-app
TAG_VERSION=${{ needs.tag-validation.outputs.tag-version }}
TAG_VERSION=${TAG_VERSION:1}
aws s3 cp ./release/ "${{ env.S3_BUCKET }}/${TAG_VERSION}/" --recursive
build-macos-x64:
Expand Down Expand Up @@ -257,11 +265,20 @@ jobs:
zip "./release/Leapp-${TAG_VERSION}-mac.zip" "./release/Leapp-${TAG_VERSION}.dmg"
zip "./release/Leapp-mac.zip" "./release/Leapp-${TAG_VERSION}.dmg"
- name: Upload artifacts
uses: actions/upload-artifact@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
name: Leapp-macos-x64
path: packages/desktop-app/release/
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Release draft to S3
run: |
cd packages/desktop-app
TAG_VERSION=${{ needs.tag-validation.outputs.tag-version }}
TAG_VERSION=${TAG_VERSION:1}
aws s3 cp ./release/ "${{ env.S3_BUCKET }}/${TAG_VERSION}/" --recursive
build-macos-arm:
runs-on: macos-latest
Expand Down Expand Up @@ -346,8 +363,94 @@ jobs:
zip "./release/Leapp-${TAG_VERSION}-mac-arm64.zip" "./release/Leapp-${TAG_VERSION}-arm64.dmg"
zip "./release/Leapp-arm-mac.zip" "./release/Leapp-${TAG_VERSION}-arm64.dmg"
- name: Upload artifacts
uses: actions/upload-artifact@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
name: Leapp-macos-arm
path: packages/desktop-app/release/
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Release draft to S3
run: |
cd packages/desktop-app
TAG_VERSION=${{ needs.tag-validation.outputs.tag-version }}
TAG_VERSION=${TAG_VERSION:1}
aws s3 cp ./release/ "${{ env.S3_BUCKET }}/${TAG_VERSION}/" --recursive
publish-draft:
runs-on: ubuntu-latest
environment: prod
needs: [ tag-validation, build-linux, build-win, build-macos-arm, build-macos-x64 ]
if: needs.tag-validation.outputs.validator == 1
steps:

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Move draft to latest
run: |
TAG_VERSION=${{ needs.tag-validation.outputs.tag-version }}
TAG_VERSION=${TAG_VERSION:1}
aws s3 rm "${{ env.S3_BUCKET }}/latest" --recursive
aws s3 cp "${{ env.S3_BUCKET }}/${TAG_VERSION}/" "${{ env.S3_BUCKET }}/latest" --recursive
publish-changelog:
runs-on: ubuntu-latest
needs: [ publish-draft ]
if: needs.tag-validation.outputs.validator == 1
steps:
- uses: actions/checkout@v3

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Publish changelog
run: |
aws s3 cp CHANGELOG.md "${{ env.S3_BUCKET }}/"
invalidate-distribution:
runs-on: ubuntu-latest
needs: [ publish-changelog ]
if: needs.tag-validation.outputs.validator == 1
steps:
- uses: actions/checkout@v3

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1

- name: Invalidate distribution
run: |
aws cloudfront create-invalidation --distribution-id ${{ env.DISTRIBUTION_ID }} --paths "/*"
publish-github-release:
runs-on: ubuntu-latest
needs: [ invalidate-distribution, tag-validation ]
if: needs.tag-validation.outputs.validator == 1
steps:
- uses: actions/checkout@v3

- name: Create GitHub Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GH_TOKEN }}
body: "Full changelog & Downloads ⇒ https://www.leapp.cloud/releases"
tag: ${{ needs.tag-validation.outputs.tag-version }}

0 comments on commit 70c1473

Please sign in to comment.