.github/workflows/cd.yml #247
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
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
required: true | |
jobs: | |
qa-installer: | |
uses: ./.github/workflows/ci.installer.yml | |
qa-action: | |
uses: ./.github/workflows/ci.action.yml | |
dist: | |
needs: [qa-installer, qa-action] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: curl -Ssf https://pkgx.sh/$(uname)/$(uname -m).tgz | sudo tar xz -C /usr/local/bin | |
- run: ./scripts/dist.sh --minify | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
put: | |
permissions: | |
contents: write | |
deployments: write | |
needs: dist | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create Deployment | |
uses: bobheadxi/deployments@v1 | |
id: deployment | |
with: | |
step: start | |
env: aws | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- uses: git-actions/set-user@v1 | |
- run: | | |
if ! git diff --exit-code; then | |
git add dist | |
git commit -m v${{ github.event.inputs.version }} | |
git tag v${{ github.event.inputs.version }} | |
git push origin v${{ github.event.inputs.version }} main | |
fi | |
- uses: softprops/action-gh-release@v1 | |
with: | |
files: ./installer.sh | |
tag_name: v${{ github.event.inputs.version }} | |
fail_on_unmatched_files: true | |
- uses: fischerscode/tagger@v0 | |
with: | |
prefix: v | |
tag: v${{ github.event.inputs.version }} | |
- run: | | |
git tag --force latest | |
git push origin latest | |
- name: Seal Deployment | |
uses: bobheadxi/deployments@v1 | |
if: always() | |
with: | |
env: aws | |
step: finish | |
status: ${{ job.status }} | |
deployment_id: ${{ steps.deployment.outputs.deployment_id }} |