Release changes, update fourmolu to v0.16 #101
Workflow file for this run
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
name: Promote | |
on: | |
# Approximate "every 2 weeks" by doing 1st and 15th of the month. | |
schedule: | |
- cron: "0 07 01 * *" | |
- cron: "0 07 15 * *" | |
# Run it if touched | |
pull_request: | |
paths: | |
- .github/workflows/promote.yml | |
# Or manually trigger | |
workflow_dispatch: | |
inputs: | |
from: | |
description: Tag to promote from | |
required: true | |
default: dev | |
to: | |
description: Tag to promote to | |
required: true | |
default: stable | |
jobs: | |
promote: | |
runs-on: ubuntu-latest | |
steps: | |
- id: prep | |
run: | | |
case "$GITHUB_EVENT_NAME" in | |
'schedule') | |
# Promote dev to stable on the schedule | |
echo 'from=dev' | |
echo 'to=stable' | |
;; | |
'pull_request') | |
# Promote dev to itself just to test our logic | |
echo 'from=dev' | |
echo 'to=dev' | |
;; | |
'workflow_dispatch') | |
# Promote what was given | |
echo 'from=${{ inputs.from }}' | |
echo 'to=${{ inputs.to }}' | |
;; | |
*) | |
echo "Unexpected event: $GITHUB_EVENT_NAME" >&2 | |
exit 1 | |
;; | |
esac >>"$GITHUB_OUTPUT" | |
env: | |
GITHUB_EVENT_NAME: ${{ github.event_name }} | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # so we can find from-tag refs | |
- id: setup-demo | |
uses: restyled-io/actions/setup-demo@v3 | |
with: | |
channel: ${{ steps.prep.outputs.from }} | |
- uses: restyled-io/actions/setup@v3 | |
- uses: restyled-io/actions/run@v3 | |
with: | |
show-patch: false | |
show-patch-command: false | |
image-cleanup: true | |
manifest: ${{ steps.setup-demo.outputs.manifest }} | |
dry-run: ${{ github.event_name == 'pull_request' }} | |
paths: . | |
- name: Download ${{ steps.prep.outputs.from }} release manifest | |
run: gh release download "${{ steps.prep.outputs.from }}" -p restylers.yaml | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: Update ${{ steps.prep.outputs.to }} tag | |
uses: rickstaa/action-create-tag@v1 | |
with: | |
tag: ${{ steps.prep.outputs.to }} | |
force_push_tag: true | |
commit_sha: "${{ steps.prep.outputs.from }}^{}" | |
- name: Add manifest to ${{ steps.prep.outputs.to }} release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ steps.prep.outputs.to }} | |
files: | | |
restylers.yaml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# TODO: update CLI to use release artifacts and stop managing this | |
- run: ./bin/promote "${{ steps.prep.outputs.to }}" | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.aws_access_key_id }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.aws_secret_access_key }} | |
AWS_DEFAULT_REGION: us-east-1 |