Skip to content

Commit

Permalink
Merge branch 'main' into ubuntu-new-version
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim authored Aug 8, 2022
2 parents c553610 + 64580b1 commit a2ad0fd
Show file tree
Hide file tree
Showing 115 changed files with 2,370 additions and 2,225 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:
otp_latest: true
- otp_release: OTP-24.3
- otp_release: OTP-24.0
- otp_release: OTP-23.3
- otp_release: OTP-23.0
- otp_release: master
development: true
- otp_release: maint
Expand Down Expand Up @@ -81,24 +79,20 @@ jobs:
name: Windows, OTP-${{ matrix.otp_release }}, Windows Server 2019
strategy:
matrix:
otp_release: ['23.3']
otp_release: ['24', '25']
runs-on: windows-2019
steps:
- name: Configure Git
run: git config --global core.autocrlf input
- uses: actions/checkout@v3
with:
fetch-depth: 50
- name: Cache Erlang/OTP package
uses: actions/cache@v3
- uses: erlef/setup-beam@v1
with:
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey\erlang
key: OTP-${{ matrix.otp_release }}-windows-2019
- name: Install Erlang/OTP
run: choco install -y erlang --version ${{ matrix.otp_release }}
otp-version: ${{ matrix.otp_release }}
- name: Compile Elixir
run: |
remove-item '.git' -recurse -force
Remove-Item -Recurse -Force '.git'
make compile
- name: Build info
run: bin/elixir --version
Expand All @@ -108,7 +102,7 @@ jobs:
run: make --keep-going test_erlang
- name: Elixir test suite
run: |
del c:/Windows/System32/drivers/etc/hosts
Remove-Item 'c:/Windows/System32/drivers/etc/hosts'
make --keep-going test_elixir
check_posix_compliant:
Expand Down
50 changes: 30 additions & 20 deletions .github/workflows/notify.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ Mix.install([
{:jason, "~> 1.0"}
])

%{status: 200, body: body} =
%{status: 200, body: release} =
Req.get!("https://api.github.com/repos/elixir-lang/elixir/releases/tags/#{tag}")

if body["draft"] do
if release["draft"] do
raise "cannot notify a draft release"
end

## Notify on elixir-lang-ann

names_and_checksums =
for asset <- body["assets"],
for asset <- release["assets"],
name = asset["name"],
name =~ ~r/.sha\d+sum$/,
do: {name, Req.get!(asset["browser_download_url"]).body}
Expand All @@ -29,34 +29,44 @@ line_items =
" * #{root} - #{type} - #{checksum}\n"
end

headers = %{
"X-Postmark-Server-Token" => System.fetch_env!("ELIXIR_LANG_ANN_TOKEN")
}

body = %{
mail = %{
"From" => "jose.valim@dashbit.co",
"To" => "elixir-lang-ann@googlegroups.com",
"Subject" => "Elixir #{tag} released",
"HtmlBody" => "https://github.com/elixir-lang/elixir/releases/tag/#{tag}\n\n#{line_items}",
"MessageStream": "outbound"
"MessageStream" => "outbound"
}

resp = Req.post!("https://api.postmarkapp.com/email", {:json, body}, headers: headers)
IO.puts("#{resp.status} elixir-lang-ann\n#{inspect(resp.body)}")
if System.get_env("DRYRUN") do
IO.puts("MAIL")
IO.inspect(mail)
else
headers = %{
"X-Postmark-Server-Token" => System.fetch_env!("ELIXIR_LANG_ANN_TOKEN")
}

## Notify on Elixir Forum
resp = Req.post!("https://api.postmarkapp.com/email", {:json, mail}, headers: headers)
IO.puts("#{resp.status} elixir-lang-ann\n#{inspect(resp.body)}")
end

headers = %{
"api-key" => System.fetch_env!("ELIXIR_FORUM_TOKEN"),
"api-username" => "Elixir"
}
## Notify on Elixir Forum

body = %{
post = %{
"title" => "Elixir #{tag} released",
"raw" => "https://github.com/elixir-lang/elixir/releases/tag/#{tag}\n\n#{body["body"]}",
"raw" => "https://github.com/elixir-lang/elixir/releases/tag/#{tag}\n\n#{release["body"]}",
# Elixir News
"category" => 28
}

resp = Req.post!("https://elixirforum.com/posts.json", {:json, body}, headers: headers)
IO.puts("#{resp.status} Elixir Forum\n#{inspect(resp.body)}")
if System.get_env("DRYRUN") do
IO.puts("POST")
IO.inspect(post)
else
headers = %{
"api-key" => System.fetch_env!("ELIXIR_FORUM_TOKEN"),
"api-username" => "Elixir"
}

resp = Req.post!("https://elixirforum.com/posts.json", {:json, post}, headers: headers)
IO.puts("#{resp.status} Elixir Forum\n#{inspect(resp.body)}")
end
4 changes: 2 additions & 2 deletions .github/workflows/notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
elixir-version: 1.13.4
- name: Run Elixir script
env:
ELIXIR_FORUM_TOKEN: ${{ secret.ELIXIR_FORUM_TOKEN }}
ELIXIR_LANG_ANN_TOKEN: ${{ secret.ELIXIR_LANG_ANN_TOKEN }}
ELIXIR_FORUM_TOKEN: ${{ secrets.ELIXIR_FORUM_TOKEN }}
ELIXIR_LANG_ANN_TOKEN: ${{ secrets.ELIXIR_LANG_ANN_TOKEN }}
run: |
elixir .github./workflows/notify.exs ${{ github.ref_name }}
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
jobs:
create_draft_release:
permissions:
contents: none
contents: write
runs-on: ubuntu-20.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -32,8 +32,6 @@ jobs:
fail-fast: true
matrix:
include:
- otp: 23
otp_version: 23.3
- otp: 24
otp_version: 24.3
- otp: 25
Expand Down
Loading

0 comments on commit a2ad0fd

Please sign in to comment.