-
Notifications
You must be signed in to change notification settings - Fork 38
55 lines (47 loc) · 1.92 KB
/
releases.yml
File metadata and controls
55 lines (47 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
on:
push:
tags:
- "**"
name: Upload Release Asset
jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
permissions:
attestations: write
id-token: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Get tag
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build project
run: git archive -o /tmp/${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.zip --prefix=${{ github.event.repository.name }}/ ${{ steps.tag.outputs.tag }}
- name: Create WP distribution files
run: bin/bundle.sh
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
/tmp/${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.zip
/tmp/fair-dist/*
- name: Upload to Fastly Object Storage
# note the plugin filename is always 'fair-connect', regardless of the repo name or slug
run: |
aws s3 cp /tmp/${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.zip s3://download.fair.pm/release/fair-connect-${{ steps.tag.outputs.tag }}.zip
aws s3 cp --recursive --exclude '*' --include '*.zip' /tmp/fair-dist s3://download.fair.pm/release/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOWNLOAD_BUCKET_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOWNLOAD_BUCKET_SECRET_KEY }}
AWS_DEFAULT_REGION: 'us-west'
AWS_ENDPOINT_URL: 'https://us-west.object.fastlystorage.app'
AWS_REQUEST_CHECKSUM_CALCULATION: 'WHEN_REQUIRED'
- name: Build provenance attestation
uses: actions/attest-build-provenance@v2
with:
subject-path: /tmp/${{ github.event.repository.name }}-${{ steps.tag.outputs.tag }}.zip