Skip to content

Commit

Permalink
update actions
Browse files Browse the repository at this point in the history
  • Loading branch information
joemaller committed Mar 26, 2024
1 parent b2a9779 commit 2fbd802
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/phpunit-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v4

- name: Validate composer.json and composer.lock
run: composer validate
Expand Down Expand Up @@ -39,6 +41,7 @@ jobs:
--verbose
- name: Upload coverage to Codecov
# https://github.com/marketplace/actions/codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: false
Expand All @@ -49,7 +52,8 @@ jobs:
# Repo Settings pane, click Test Coverage in the left sidebar. Find the ID in the
# second section.
- name: Code Climate coverage
uses: paambaati/[email protected]
# https://github.com/marketplace/actions/code-climate-coverage-action
uses: paambaati/codeclimate-action@v5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/release-from-version-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
name: Build Release
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v4

- name: Set up REPO and TAG environment vars
run: |
Expand All @@ -33,7 +35,7 @@ jobs:
composer archive -f zip --dir=../ --file=${REPO}
- name: Create GitHub release
if: ${{ contains(github.ref, 'refs/tags/') }}
if: github.ref == 'refs/heads/main' && contains(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
20 changes: 10 additions & 10 deletions example/.github/workflows/publish-to-aws.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Create Release & Publish to S3
name: Build and Publish

on:
push:
branches: "*"
branches: ["*"]
tags: ["v*"]

env:
Expand All @@ -13,11 +13,13 @@ env:

jobs:
build:
runs-on: ubuntu-20.04
name: Build, bundle and deploy to AWS
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
# https://github.com/marketplace/actions/checkout
- uses: actions/checkout@v4

- name: Set up REPO and TAG environment vars
run: |
Expand All @@ -29,10 +31,7 @@ jobs:
run: |
echo "TAG=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Validate composer.json and composer.lock
run: composer validate

- name: Install PHP dependencies
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Create Zip Archive
Expand All @@ -47,7 +46,8 @@ jobs:
npx marked -o assets/changelog.html CHANGELOG.md
- name: Store Artifact
uses: actions/upload-artifact@v2
# https://github.com/marketplace/actions/upload-a-build-artifact#v4---whats-new
uses: actions/upload-artifact@v4
with:
name: ${{ env.REPO }}
path: |
Expand All @@ -64,7 +64,7 @@ jobs:
gh release create v${TAG} ../${REPO}.zip
- name: Send artifacts to S3
if: ${{ contains(github.ref, 'refs/tags/') && env.AWS_ACCESS_KEY_ID }}
if: github.ref == 'refs/heads/main' && contains(github.ref, 'refs/tags/') && env.AWS_ACCESS_KEY_ID
run: |
aws s3 sync assets $S3_URI/${REPO}
aws s3 cp ../${REPO}.zip ${S3_URI}/${REPO}/${REPO}_${TAG}.zip

0 comments on commit 2fbd802

Please sign in to comment.