Skip to content

Commit

Permalink
Merge branch 'main' into JamesMGreene-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMGreene authored May 2, 2024
2 parents 39a95da + bb87865 commit 36a9e81
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 51 deletions.
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ updates:
directory: "/"
schedule:
interval: "weekly"
groups:
non-breaking-changes:
update-types: [minor, patch]
4 changes: 2 additions & 2 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
draft-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: release-drafter/release-drafter@v5
- uses: actions/checkout@v4
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
steps:
- name: Update the ${{ env.TAG_NAME }} tag
id: update-major-tag
uses: actions/publish-action@v0.2.2
uses: actions/publish-action@v0.3.0
with:
source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
7 changes: 4 additions & 3 deletions .github/workflows/test-hosted-runners.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Generate files
run: mkdir artifact && mkdir artifact2 && cd artifact && ../script/new-artifact.sh
Expand All @@ -31,12 +31,13 @@ jobs:
- name: Upload Pages artifact
uses: ./
with:
name: pages-artifact-${{ matrix.os }}
path: artifact

- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: github-pages
name: pages-artifact-${{ matrix.os }}
path: artifact2

- name: Extract artifact
Expand Down
45 changes: 1 addition & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

A composite Action for packaging and uploading artifact that can be deployed to [GitHub Pages][pages].

## Scope

⚠️ Official support for building Pages with Actions is in public beta at the moment.

## Usage

See [action.yml](action.yml)
Expand All @@ -27,46 +23,7 @@ The [`tar` file][tar] must:
- :warning: The GitHub Pages [officially supported maximum size limit is 1GB][pages-usage-limits], so the subsequent deployment of larger tarballs are not guaranteed to succeed — often because they are more prone to exceeding the maximum deployment timeout of 10 minutes.
- ⛔ However, there is also an _unofficial_ absolute maximum size limit of 10GB, which Pages will not even _attempt_ to deploy.
- not contain any symbolic or hard links
- contain only files and directories that all meet the expected minimum [file permissions](#file-permissions)

### File permissions

When using this action, ensure that your files have appropriate file permissions.
At a minimum, GitHub Pages expects:
- files to have read permission for the current user and the "Others" user role (e.g. `0744`, `0644`, `0444`)
- directories to have read and execute permissions for the current user and the "Others" user role (e.g. `0755`, `0555`)

Failure to supply adequate permissions will result in a `deployment_perms_error` when attempting to deploy your artifacts to GitHub Pages.

#### Example permissions fix for Linux

```yaml
steps:
# ...
- name: Fix permissions
run: |
chmod -c -R +rX "_site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
# ...
```

#### Example permissions fix for Mac

```yaml
steps:
# ...
- name: Fix permissions
run: |
chmod -v -R +rX "_site/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
# ...
```
- contain only files and directories

## Release instructions

Expand Down
13 changes: 12 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,26 @@ inputs:
description: "Duration after which artifact will expire in days."
required: false
default: "1"
outputs:
artifact_id:
description: "The ID of the artifact that was uploaded."
value: ${{ steps.upload-artifact.outputs.artifact-id }}
runs:
using: composite
steps:
- name: Archive artifact
shell: sh
if: runner.os == 'Linux'
run: |
echo ::group::Archive artifact
tar \
--dereference --hard-dereference \
--directory "$INPUT_PATH" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
echo ::endgroup::
env:
INPUT_PATH: ${{ inputs.path }}

Expand All @@ -36,13 +42,15 @@ runs:
shell: sh
if: runner.os == 'macOS'
run: |
echo ::group::Archive artifact
gtar \
--dereference --hard-dereference \
--directory "$INPUT_PATH" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
echo ::endgroup::
env:
INPUT_PATH: ${{ inputs.path }}

Expand All @@ -51,6 +59,7 @@ runs:
shell: bash
if: runner.os == 'Windows'
run: |
echo ::group::Archive artifact
tar \
--dereference --hard-dereference \
--directory "$INPUT_PATH" \
Expand All @@ -59,11 +68,13 @@ runs:
--exclude=.github \
--force-local \
"."
echo ::endgroup::
env:
INPUT_PATH: ${{ inputs.path }}

- name: Upload artifact
uses: actions/upload-artifact@v3
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}
path: ${{ runner.temp }}/artifact.tar
Expand Down

0 comments on commit 36a9e81

Please sign in to comment.