Skip to content

Commit

Permalink
differ dev release and prod release in CI/CD pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
angelo-v committed Oct 15, 2021
1 parent 993aa9e commit a949b0b
Showing 1 changed file with 32 additions and 4 deletions.
36 changes: 32 additions & 4 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
package.json
retention-days: 1

release:
pre-release:
needs: build
runs-on: ubuntu-latest
steps:
Expand All @@ -50,13 +50,41 @@ jobs:
filename: webclip-${{ steps.extract_version.outputs.version }}.zip
directory: 'build'

- name: Create draft release
- name: Save zip
uses: actions/upload-artifact@v2
with:
name: zip
path: build/webclip-${{ steps.extract_version.outputs.version }}.zip
retention-days: 30

- name: Create pre-release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.extract_version.outputs.version }}
tag: ${{ steps.extract_version.outputs.version }}-dev
commit: ${{ github.sha }}
prerelease: true
draft: true
allowUpdates: true
artifacts: "build/*.zip"
token: ${{ secrets.GITHUB_TOKEN }}

release:
needs: pre-release
environment: prod
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: zip

- name: Extract version
id: extract_version
uses: Saionaro/extract-package-version@v1.0.6

- name: Create draft release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.extract_version.outputs.version }}
commit: ${{ github.sha }}
allowUpdates: false
artifacts: "build/*.zip"
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit a949b0b

Please sign in to comment.