Skip to content

Commit

Permalink
Merge pull request #2259 from tsloughter/relx-4-1
Browse files Browse the repository at this point in the history
prepare for 3.14.0-rc1
  • Loading branch information
tsloughter authored Apr 18, 2020
2 parents 9076a48 + 99523bc commit 11936db
Show file tree
Hide file tree
Showing 10 changed files with 126 additions and 33 deletions.
44 changes: 23 additions & 21 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,30 @@ nightly_task:
ACCESS_KEY: ENCRYPTED[86c639224b3cfc11ae5dbd48b13de5ff77dd5c75f1bf1808ddbbb5bc60049f16885b4e2e3a7981376cac562f7a2d176b]
SECRET_KEY: ENCRYPTED[189c3b982c2f846193bb34c3de86e0172b8a4c793699f64dc95bb9a1e6bbe83c252c77d37ea1503928aa9b41a3652ca3]

release_task:
container:
image: erlang:18
depends_on:
- test
only_if: $CIRRUS_TAG != ''
script: |
apt-get update
apt-get install -y s3cmd
./bootstrap
s3cmd --access_key=$ACCESS_KEY --secret_key=$SECRET_KEY put ./rebar3 s3://rebar3
# Removed while making pre-release -rc versions so they don't override the stable release in s3

url_to_upload="https://uploads.github.com/repos/$CIRRUS_REPO_FULL_NAME/releases/$CIRRUS_RELEASE/assets?name=rebar3"
curl -X POST \
--data-binary @rebar3 \
--header "Authorization: token $GITHUB_TOKEN" \
--header "Content-Type: application/octet-stream" \
$url_to_upload
environment:
ACCESS_KEY: ENCRYPTED[86c639224b3cfc11ae5dbd48b13de5ff77dd5c75f1bf1808ddbbb5bc60049f16885b4e2e3a7981376cac562f7a2d176b]
SECRET_KEY: ENCRYPTED[189c3b982c2f846193bb34c3de86e0172b8a4c793699f64dc95bb9a1e6bbe83c252c77d37ea1503928aa9b41a3652ca3]
GITUB_TOKEN: ENCRYPTED[ff884c4b0a4f2833b6c22c1fd6398879d58634d0f521e7efbd33f045fb785417f24da953cfbdaee563698501691e5970]
# release_task:
# container:
# image: erlang:18
# depends_on:
# - test
# only_if: $CIRRUS_TAG != ''
# script: |
# apt-get update
# apt-get install -y s3cmd
# ./bootstrap
# s3cmd --access_key=$ACCESS_KEY --secret_key=$SECRET_KEY put ./rebar3 s3://rebar3

# url_to_upload="https://uploads.github.com/repos/$CIRRUS_REPO_FULL_NAME/releases/$CIRRUS_RELEASE/assets?name=rebar3"
# curl -X POST \
# --data-binary @rebar3 \
# --header "Authorization: token $GITHUB_TOKEN" \
# --header "Content-Type: application/octet-stream" \
# $url_to_upload
# environment:
# ACCESS_KEY: ENCRYPTED[86c639224b3cfc11ae5dbd48b13de5ff77dd5c75f1bf1808ddbbb5bc60049f16885b4e2e3a7981376cac562f7a2d176b]
# SECRET_KEY: ENCRYPTED[189c3b982c2f846193bb34c3de86e0172b8a4c793699f64dc95bb9a1e6bbe83c252c77d37ea1503928aa9b41a3652ca3]
# GITUB_TOKEN: ENCRYPTED[ff884c4b0a4f2833b6c22c1fd6398879d58634d0f521e7efbd33f045fb785417f24da953cfbdaee563698501691e5970]


# Windows CI appears broken for now and never passes
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Common Test

on:
pull_request:
branches:
- 'master'
push:
branches:
- 'master'

jobs:
build:
name: Test on OTP ${{ matrix.otp_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
otp_version: [19, 20, 21, 22, 23]
os: [ubuntu-latest]

container:
image: erlang:${{ matrix.otp_version }}

steps:
- uses: actions/checkout@v1
- name: Compile
run: ./bootstrap
- name: CT tests
run: ./rebar3 ct
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish

on:
release:
types: [published, prereleased]

jobs:
build:
name: Publish escript to release
runs-on: ubuntu-latest

container:
image: erlang:19

steps:
- uses: actions/checkout@v1
- name: Compile
run: ./bootstrap
- name: CT tests
run: ./rebar3 ct

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./rebar3
asset_name: rebar3
asset_content_type: application/zip

- name: Configure AWS credentials
if: "!github.event.release.prerelease"
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Copy rebar3 escript to S3
if: "!github.event.release.prerelease"
run: |
aws s3 sync ./rebar3 s3://rebar3
2 changes: 1 addition & 1 deletion bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ main(_) ->
bootstrap_rebar3(),

%% Build rebar.app from rebar.app.src
{ok, App} = rebar_app_info:new(rebar, "3.13.0", filename:absname("_build/default/lib/rebar/")),
{ok, App} = rebar_app_info:new(rebar, "3.14.0-rc1", filename:absname("_build/default/lib/rebar/")),
rebar_otp_app:compile(rebar_state:new(), App),

%% Because we are compiling files that are loaded already we want to silence
Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{getopt, "1.0.1"},
{bbmustache, "1.8.0"},
%% {relx, "3.33.0"},
{relx, {git, "https://github.com/erlware/relx.git", {branch, "4.0.0"}}},
{relx, {git, "https://github.com/erlware/relx.git", {tag, "v4.0.0-rc1"}}},
{cf, "0.2.2"},
{cth_readable, "1.4.8"},
{eunit_formatters, "0.5.0"}]}.
Expand Down
17 changes: 14 additions & 3 deletions rebar.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{"1.1.0",
{"1.2.0",
[{<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.8.0">>},0},
{<<"certifi">>,{pkg,<<"certifi">>,<<"2.5.1">>},0},
{<<"cf">>,{pkg,<<"cf">>,<<"0.2.2">>},0},
Expand All @@ -10,7 +10,7 @@
{<<"providers">>,{pkg,<<"providers">>,<<"1.8.1">>},0},
{<<"relx">>,
{git,"https://github.com/erlware/relx.git",
{ref,"ad25111b7349c633fbec30f26c1ad03361d6b806"}},
{ref,"e3b61cd8eab04609c4b0e684dfb564e788446d53"}},
0},
{<<"ssl_verify_fun">>,{pkg,<<"ssl_verify_fun">>,<<"1.1.5">>},0}]}.
[
Expand All @@ -24,5 +24,16 @@
{<<"getopt">>, <<"C73A9FA687B217F2FF79F68A3B637711BB1936E712B521D8CE466B29CBF7808A">>},
{<<"parse_trans">>, <<"09765507A3C7590A784615CFD421D101AEC25098D50B89D7AA1D66646BC571C1">>},
{<<"providers">>, <<"70B4197869514344A8A60E2B2A4EF41CA03DEF43CFB1712ECF076A0F3C62F083">>},
{<<"ssl_verify_fun">>, <<"6EAF7AD16CB568BB01753DBBD7A95FF8B91C7979482B95F38443FE2C8852A79B">>}]}
{<<"ssl_verify_fun">>, <<"6EAF7AD16CB568BB01753DBBD7A95FF8B91C7979482B95F38443FE2C8852A79B">>}]},
{pkg_hash_ext,[
{<<"bbmustache">>, <<"190EA2206128BDFABF5D9200B8DF97F6511D9C62953655828E28C2BC79161252">>},
{<<"certifi">>, <<"805ABD97539CAF89EC6D4732C91E62BA9DA0CDA51AC462380BBD28EE697A8C42">>},
{<<"cf">>, <<"48283B3019BC7FAD56E7B23028A5DA4D3E6CD598A553AB2A99A2153BF5F19B21">>},
{<<"cth_readable">>, <<"46C3BB14DF581DC7A9DC0CB9E8C755BFF596665FB9A23148DD76E3A200804E90">>},
{<<"erlware_commons">>, <<"7AADA93F368D0A0430122E39931B7FB4AC9E94DBF043CDC980AD4330FD9CD166">>},
{<<"eunit_formatters">>, <<"D6C8BA213424944E6E05BBC097C32001CDD0ABE3925D02454F229B20D68763C9">>},
{<<"getopt">>, <<"53E1AB83B9CEB65C9672D3E7A35B8092E9BDC9B3EE80721471A161C10C59959C">>},
{<<"parse_trans">>, <<"17EF63ABDE837AD30680EA7F857DD9E7CED9476CDD7B0394432AF4BFC241B960">>},
{<<"providers">>, <<"E45745ADE9C476A9A469EA0840E418AB19360DC44F01A233304E118A44486BA0">>},
{<<"ssl_verify_fun">>, <<"13104D7897E38ED7F044C4DE953A6C28597D1C952075EB2E328BC6D6F2BFC496">>}]}
].
2 changes: 1 addition & 1 deletion src/rebar.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{application, rebar,
[{description, "Rebar: Erlang Build Tool"},
{vsn, "git"},
{vsn, "3.14.0-rc1"},
{modules, []},
{registered, []},
{applications, [kernel,
Expand Down
2 changes: 1 addition & 1 deletion src/rebar_prv_tar.erl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
-include("rebar.hrl").

-define(PROVIDER, tar).
-define(DEPS, [release]).
-define(DEPS, [compile]).

%% ===================================================================
%% Public API
Expand Down
16 changes: 11 additions & 5 deletions src/rebar_relx.erl
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,20 @@ do(Provider, State) ->
ProfileString = rebar_dir:profile_dir_name(State),
ExtraOverlays = [{profile_string, ProfileString}],

CurrentProfiles = rebar_state:current_profiles(State),
RelxMode = case lists:member(prod, CurrentProfiles) of
true ->
[{mode, prod}];
false ->
[]
end,
DefaultOutputDir = filename:join(rebar_dir:base_dir(State), ?DEFAULT_RELEASE_DIR),
RelxConfig1 = [output_dir(DefaultOutputDir, Opts),
{overlay_vars_values, ExtraOverlays},
{overlay_vars, [{base_dir, rebar_dir:base_dir(State)}]}
| merge_overlays(RelxConfig)],
RelxConfig1 = RelxMode ++ [output_dir(DefaultOutputDir, Opts),
{overlay_vars_values, ExtraOverlays},
{overlay_vars, [{base_dir, rebar_dir:base_dir(State)}]}
| merge_overlays(RelxConfig)],
{ok, RelxState} = rlx_config:to_state(RelxConfig1),


Providers = rebar_state:providers(State),
Cwd = rebar_state:dir(State),
rebar_hooks:run_project_and_app_hooks(Cwd, pre, Provider, Providers, State),
Expand Down
1 change: 1 addition & 0 deletions test/rebar_release_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ profile_overlays(Config) ->
{lib_dirs, [AppDir]}]},
{profiles, [{prod,
[{relx, [
{debug_info, keep},
{overlay_vars, filename:join(AppDir, "prod.vars")},
{overlay, [{mkdir, "otherrandomdir"},
{copy, filename:join(AppDir, "./prod.file"), "{{env}}.file"},
Expand Down

0 comments on commit 11936db

Please sign in to comment.