From 27accbc52ab402db60b0615d0b3146e52049364e Mon Sep 17 00:00:00 2001 From: Florian Friedrich Date: Mon, 24 Oct 2022 12:37:07 +0200 Subject: [PATCH] Split test and deployment --- .github/workflows/deploy.yml | 32 ++++++++++++++++++++++++++++ .github/workflows/tag-update.yml | 4 ++-- .github/workflows/tests.yml | 36 +++----------------------------- 3 files changed, 37 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..c1eeeba --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,32 @@ +name: Deploy Action Code + +on: + push: + branches: [ master ] + paths-ignore: [ 'dist/*.js' ] + +jobs: + deploy-action-code: + name: Deploy Action Code + runs-on: ubuntu-latest + steps: + - name: Install depenedencies + run: sudo npm i -g typescript @vercel/ncc + - uses: actions/checkout@v3.1.0 + with: + token: ${{ secrets.BOT_TOKEN }} + - name: Generate action code + run: npm run deploy + - name: Configure repository + env: + BOT_USERNAME: ${{ secrets.BOT_USERNAME }} + run: | + git config user.name "${BOT_USERNAME}" + git config user.email "${BOT_USERNAME}@users.noreply.github.com" + - name: Commit changes + run: | + if ! git diff --exit-code --quiet; then + git add . + git commit -m '[AUTO] Update generated code' + git push + fi diff --git a/.github/workflows/tag-update.yml b/.github/workflows/tag-update.yml index 5b082d9..7586be2 100644 --- a/.github/workflows/tag-update.yml +++ b/.github/workflows/tag-update.yml @@ -10,8 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3.1.0 - - uses: sersoft-gmbh/running-release-tags-action@v2.1.0 + - uses: sersoft-gmbh/running-release-tags-action@v2.1.1 + if: ${{ github.event.release.prerelease == false }} with: update-full-release: true github-token: ${{ secrets.GITHUB_TOKEN }} - if: github.event.release.prerelease == false diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 64fa75b..172cd61 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,40 +3,14 @@ name: Tests on: push: branches: [ master ] - paths-ignore: [ 'dist/*.js' ] + paths: + - 'dist/*.js' + - '.github/workflows/tests.yml' pull_request: branches: [ master ] jobs: - deploy-action-code: - if: ${{ github.event_name == 'push' }} - name: Deploy Action Code - runs-on: ubuntu-latest - steps: - - name: Install depenedencies - run: sudo npm i -g typescript @vercel/ncc - - uses: actions/checkout@v3.1.0 - with: - token: ${{ secrets.BOT_TOKEN }} - - name: Generate action code - run: npm run deploy - - name: Configure repository - env: - BOT_USERNAME: ${{ secrets.BOT_USERNAME }} - run: | - git config user.name "${BOT_USERNAME}" - git config user.email "${BOT_USERNAME}@users.noreply.github.com" - - name: Commit changes - run: | - if ! git diff --exit-code --quiet; then - git add . - git commit -m '[AUTO] Update generated code' - git push - fi - test-release: - needs: deploy-action-code - if: ${{ always() && !failure() && !cancelled() }} name: Test Release Installation strategy: matrix: @@ -89,8 +63,6 @@ jobs: run: swift --version | grep -q "${EXPECTED_VERSION}" test-branch: - needs: deploy-action-code - if: ${{ always() && !failure() && !cancelled() }} name: Test Branch Installation strategy: matrix: @@ -143,8 +115,6 @@ jobs: run: swift --version | grep -q "${EXPECTED_VERSION}" test-release-noplatform: - needs: deploy-action-code - if: ${{ always() && !failure() && !cancelled() }} name: Test Release Installation w/o Platform strategy: matrix: