-
Notifications
You must be signed in to change notification settings - Fork 37
98 lines (85 loc) · 3.25 KB
/
Copy pathreusable-extension-build.yml
File metadata and controls
98 lines (85 loc) · 3.25 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: extension-build
on:
workflow_call:
inputs:
version:
required: true
type: string
description: "Version string for artifact and release names"
prerelease:
required: false
type: boolean
default: false
description: "Create a GitHub Pre-release instead of Release"
dry-run:
required: false
type: boolean
default: false
description: "Skip GitHub release"
tag-name:
required: false
type: string
default: ""
description: "Git tag for the release (defaults to GITHUB_REF_NAME)"
env:
ROOT_DIR: apps/extension/
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
fetch-depth: 1
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25
with:
extra-conf: |
accept-flake-config = true
- name: Cache Nix store
uses: DeterminateSystems/magic-nix-cache-action@6221693898146dc97e38ad0e013488a16477a4c4
continue-on-error: true
- name: Build & zip
run: |
unset CI && nix develop --command moon run extension:zip
unset CI && nix develop --command moon run extension:zip-firefox
- name: Rename zips
run: |
mv ${{ env.ROOT_DIR }}.output/*-chrome.zip ${{ env.ROOT_DIR }}.output/job-hunting-extension-chrome-${{ inputs.version }}.zip
mv ${{ env.ROOT_DIR }}.output/*-firefox.zip ${{ env.ROOT_DIR }}.output/job-hunting-extension-firefox-${{ inputs.version }}.zip
- name: Upload artifacts
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1
with:
name: extension-${{ inputs.version }}
path: |
${{ env.ROOT_DIR }}.output/job-hunting-extension-chrome-${{ inputs.version }}.zip
${{ env.ROOT_DIR }}.output/job-hunting-extension-firefox-${{ inputs.version }}.zip
- uses: ./.github/actions/extract-changelog
if: ${{ !inputs.prerelease }}
with:
changelog-path: ${{ env.ROOT_DIR }}CHANGELOG.md
output-path: /tmp/RELEASE_BODY.md
- name: Prepare generic body
if: ${{ inputs.prerelease }}
run: |
{
echo "Dev build from \`${GITHUB_SHA:0:7}\`"
echo ""
echo "Run number: ${GITHUB_RUN_NUMBER}"
echo "Date: $(date -u +%Y%m%d)"
echo "Version: ${{ inputs.version }}"
} > /tmp/RELEASE_BODY.md
- name: Create Release
if: ${{ !inputs.dry-run }}
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda
with:
token: ${{ github.token }}
body_path: /tmp/RELEASE_BODY.md
prerelease: ${{ inputs.prerelease }}
make_latest: ${{ !inputs.prerelease }}
tag_name: ${{ inputs.tag-name || github.ref_name }}
name: ${{ inputs.tag-name || github.ref_name }}
files: |
${{ env.ROOT_DIR }}.output/job-hunting-extension-chrome-${{ inputs.version }}.zip
${{ env.ROOT_DIR }}.output/job-hunting-extension-firefox-${{ inputs.version }}.zip