-
Notifications
You must be signed in to change notification settings - Fork 92
122 lines (107 loc) · 4.91 KB
/
Copy pathpublish.yml
File metadata and controls
122 lines (107 loc) · 4.91 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# This workflow builds the gnome extension for release on extensions.gnome.org
# For more information see:
#@ https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: release
permissions:
contents: read
pull-requests: write
on:
release:
types: [published]
workflow_dispatch:
inputs:
ref:
description: "Override git ref"
type: string
default: ""
required: false
jobs:
publishing:
strategy:
matrix:
node_version: ["latest"]
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Install linux tools
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gettext make zip curl
- name: Set up Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- name: Install Node.js project dependencies
run: npm ci --verbose
# - name: Build Node.js project
# run: npm run build --if-present --verbose
# - name: Test Node.js project
# run: npm test --verbose
- name: Test Packaging
run: make dist
- name: Archive release artifacts
uses: actions/upload-artifact@v4
with:
name: forge-gnome-extension
path: forge@jmmaranan.com.zip
# - name: Upload extension to Goe
# shell: bash
# env:
# USERNAME: ${{ secrets.GOE_USERNAME }}
# PASSWORD: ${{ secrets.GOE_PASSWORD }}
# run: |
# printf '::group::Getting CSRF Midleware Token for accounts/login form\n';
# if test -z "${USERNAME:-}"; then printf 'Missing USERNAME from environment variable.\n::endgroup::\n'; exit 1; fi
# if test -z "${PASSWORD:-}"; then printf 'Missing PASSWORD from environment variable\n::endgroup::\n'; exit 1; fi
# curl 'https://extensions.gnome.org/accounts/login/' \
# --junk-session-cookies \
# -b 00-cookies-jar.txt -c 00-cookies-jar.txt \
# --location --fail-with-body \
# --no-progress-meter --verbose \
# -o 01-get-accounts-login.html;
# export CSRFMIDDLEWARETOKEN="$(grep --color=never 'csrfmiddlewaretoken' < 01-get-accounts-login.html | grep --only-matching --perl-regexp '(?<=value=.)([^\"]+)' | head -n 1)";
# if test -z "${CSRFMIDDLEWARETOKEN:-}"; then printf 'Missing CSRFMIDDLEWARETOKEN from accounts/login form.\n::endgroup::\n'; exit 1; fi
# printf '::endgroup::\n';
# printf '::group::Authenticating in extensions.gnome.org\n';
# if ! curl 'https://extensions.gnome.org/accounts/login/' \
# -H 'origin: https://extensions.gnome.org' \
# -H 'referer: https://extensions.gnome.org/accounts/login/' \
# -H 'content-type: application/x-www-form-urlencoded' \
# --data-urlencode 'next=' \
# --data-urlencode "csrfmiddlewaretoken=${CSRFMIDDLEWARETOKEN}" \
# --data-urlencode "username=${USERNAME}" \
# --data-urlencode "password=${PASSWORD}" \
# -b 00-cookies-jar.txt -c 00-cookies-jar.txt \
# --location --fail-with-body \
# --no-progress-meter --verbose \
# -o 02-post-accounts-login.html;
# then
# printf 'Login failed with error: %s\n::endgroup::\n' "$?";
# exit 2;
# fi
# printf '::endgroup::\n';
# printf '::group::Getting CSRF Midleware Token for upload form\n';
# curl 'https://extensions.gnome.org/upload/' \
# -b 00-cookies-jar.txt -c 00-cookies-jar.txt \
# --location --fail-with-body \
# --no-progress-meter --verbose \
# -o 03-get-upload.html;
# export CSRFMIDDLEWARETOKEN="$(grep --color=never 'csrfmiddlewaretoken' < 03-get-upload.html | grep --only-matching --perl-regexp '(?<=value=.)([^\"]+)' | head -n 1)";
# if test -z "${CSRFMIDDLEWARETOKEN:-}"; then printf 'Missing CSRFMIDDLEWARETOKEN from upload form.\n::endgroup::\n'; exit 3; fi
# printf '::endgroup::\n';
# printf '::group::Uploading extension zip\n';
# curl 'https://extensions.gnome.org/upload/' \
# -H 'origin: https://extensions.gnome.org' \
# -H 'referer: https://extensions.gnome.org/upload/' \
# -F "csrfmiddlewaretoken=${CSRFMIDDLEWARETOKEN}" \
# -F 'tos_compliant=on' \
# -F 'shell_license_compliant=on' \
# -F 'source=@forge@jmmaranan.com.zip' \
# -b 00-cookies-jar.txt -c 00-cookies-jar.txt \
# --location --fail-with-body \
# --no-progress-meter --verbose \
# -o 04-post-upload.html;
# printf '::endgroup::\n';